ONOS-4078: ISIS protocol API initial checkin.

Change-Id: I89743341348148835dc196321852945a20469c87
diff --git a/protocols/isis/api/pom.xml b/protocols/isis/api/pom.xml
new file mode 100644
index 0000000..2671496
--- /dev/null
+++ b/protocols/isis/api/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-isis</artifactId>
+        <version>1.6.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-isis-api</artifactId>
+    <packaging>bundle</packaging>
+
+    <description>ONOS ISIS controller subsystem API</description>
+
+    <dependencies>
+       <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-api</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisController.java b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisController.java
new file mode 100644
index 0000000..b1204c9
--- /dev/null
+++ b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisController.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.isis.controller;
+
+import java.util.List;
+
+/**
+ * Representation of an ISIS controller.
+ */
+public interface IsisController {
+
+    /**
+     * Registers a listener for router meta events.
+     *
+     * @param isisRouterListener isis router listener instance
+     */
+    void addRouterListener(IsisRouterListener isisRouterListener);
+
+    /**
+     * Unregisters a router listener.
+     *
+     * @param isisRouterListener isis router listener instance
+     */
+    void removeRouterListener(IsisRouterListener isisRouterListener);
+
+    /**
+     * Updates configuration of processes.
+     *
+     * @param processes process instance to update
+     */
+    void updateConfig(List<IsisProcess> processes);
+
+    /**
+     * Deletes configuration parameters.
+     *
+     * @param processes list of process instance
+     * @param attribute attribute to delete
+     */
+    void deleteConfig(List<IsisProcess> processes, String attribute);
+
+    /**
+     * Gets the all configured processes.
+     *
+     * @return list of process instances
+     */
+    List<IsisProcess> allConfiguredProcesses();
+}
\ No newline at end of file
diff --git a/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisInterface.java b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisInterface.java
new file mode 100644
index 0000000..d1fec1c
--- /dev/null
+++ b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisInterface.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.isis.controller;
+
+/**
+ * Representation of an ISIS interface.
+ */
+public interface IsisInterface {
+
+    /**
+     * Sets interface index.
+     *
+     * @param interfaceIndex interface index
+     */
+    void setInterfaceIndex(int interfaceIndex);
+
+    /**
+     * Sets intermediate system name.
+     *
+     * @param intermediateSystemName intermediate system name
+     */
+    void setIntermediateSystemName(String intermediateSystemName);
+
+    /**
+     * Sets system ID.
+     *
+     * @param systemId system ID
+     */
+    void setSystemId(String systemId);
+
+    /**
+     * Sets LAN ID.
+     *
+     * @param lanId LAN ID
+     */
+    void setLanId(String lanId);
+
+    /**
+     * Sets ID length.
+     *
+     * @param idLength ID length
+     */
+    void setIdLength(int idLength);
+
+    /**
+     * Sets max area addresses.
+     *
+     * @param maxAreaAddresses max area addresses
+     */
+    void setMaxAreaAddresses(int maxAreaAddresses);
+
+    /**
+     * Sets reserved packet circuit type.
+     *
+     * @param reservedPacketCircuitType reserved packet circuit type
+     */
+    void setReservedPacketCircuitType(int reservedPacketCircuitType);
+
+    /**
+     * Sets point to point.
+     *
+     * @param p2p point to point
+     */
+    void setP2p(int p2p);
+
+    /**
+     * Sets area address.
+     *
+     * @param areaAddress area address
+     */
+    void setAreaAddress(String areaAddress);
+
+    /**
+     * Sets area length.
+     *
+     * @param areaLength area length
+     */
+    void setAreaLength(int areaLength);
+
+    /**
+     * Sets link state packet ID.
+     *
+     * @param lspId link state packet ID
+     */
+    void setLspId(String lspId);
+
+    /**
+     * Sets holding time.
+     *
+     * @param holdingTime holding time
+     */
+    void setHoldingTime(int holdingTime);
+
+    /**
+     * Sets priority.
+     *
+     * @param priority priority
+     */
+    void setPriority(int priority);
+
+    /**
+     * Sets hello interval.
+     *
+     * @param helloInterval hello interval
+     */
+    void setHelloInterval(int helloInterval);
+}
\ No newline at end of file
diff --git a/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisLsdb.java b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisLsdb.java
new file mode 100644
index 0000000..8ed8575
--- /dev/null
+++ b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisLsdb.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.isis.controller;
+
+/**
+ * Representation of an ISIS link state database.
+ */
+public interface IsisLsdb {
+
+    /**
+     * Gets the ISIS LSDB.
+     *
+     * @return ISIS LSDB
+     */
+    IsisLsdb isisLsdb();
+}
\ No newline at end of file
diff --git a/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisMessage.java b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisMessage.java
new file mode 100644
index 0000000..93c0139
--- /dev/null
+++ b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisMessage.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.isis.controller;
+
+/**
+ * Representation of an ISIS Message.
+ */
+public interface IsisMessage {
+
+    /**
+     * Gets the type of ISIS PDU.
+     *
+     * @return ISIS PDU type instance
+     */
+    IsisPduType isisPduType();
+}
\ No newline at end of file
diff --git a/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisPduType.java b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisPduType.java
new file mode 100644
index 0000000..78c3c8a
--- /dev/null
+++ b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisPduType.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.isis.controller;
+
+/**
+ * Representation of ISIS PDU types.
+ */
+public enum IsisPduType {
+
+    /**
+     * Represents Level-1 LAN hello packet.
+     */
+    L1HELLOPDU(15),
+    /**
+     * Represents Level-2 LAN hello packet.
+     */
+    L2HELLOPDU(16),
+    /**
+     * Represents point-to-point hello packet.
+     */
+    P2PHELLOPDU(17),
+    /**
+     * Represents Level-1 link state packet.
+     */
+    L1LSPDU(18),
+    /**
+     * Represents Level-2 link state packet.
+     */
+    L2LSPDU(20),
+    /**
+     * Represents Level-1 complete sequence number packet.
+     */
+    L1CSNP(24),
+    /**
+     * Represents Level-2 complete sequence number packet.
+     */
+    L2CSNP(25),
+    /**
+     * Represents Level-1 partial sequence number packet.
+     */
+    L1PSNP(26),
+    /**
+     * Represents Level-2 partial sequence number packet.
+     */
+    L2PSNP(27);
+
+    private int value;
+
+
+    /**
+     * Creates an instance of ISIS PDU type.
+     *
+     * @param value represents ISIS PDU type
+     */
+    private IsisPduType(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets the value representing PDU type.
+     *
+     * @return value represents PDU type
+     */
+    public int value() {
+        return value;
+    }
+}
\ No newline at end of file
diff --git a/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisProcess.java b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisProcess.java
new file mode 100644
index 0000000..25eec0c
--- /dev/null
+++ b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisProcess.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.isis.controller;
+
+import java.util.List;
+
+/**
+ * Representation of an ISIS process.
+ */
+public interface IsisProcess {
+
+    /**
+     * Sets process ID.
+     *
+     * @param processId process ID
+     */
+    void setProcessId(String processId);
+
+    /**
+     * Sets list of ISIS interfaces.
+     *
+     * @param isisInterfaceList list of ISIS interface details
+     */
+    void setIsisInterfaceList(List<IsisInterface> isisInterfaceList);
+}
\ No newline at end of file
diff --git a/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisRouter.java b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisRouter.java
new file mode 100644
index 0000000..256e351
--- /dev/null
+++ b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisRouter.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.isis.controller;
+
+import org.onlab.packet.Ip4Address;
+
+/**
+ * Abstraction of an ISIS Router.
+ */
+public interface IsisRouter {
+
+    /**
+     * Gets IP address of the router.
+     *
+     * @return IP address of the router
+     */
+    Ip4Address routerIp();
+
+    /**
+     * Gets IP address of the interface.
+     *
+     * @return IP address of the interface
+     */
+    Ip4Address interfaceId();
+
+    /**
+     * Sets IP address of the Router.
+     *
+     * @param routerIp IP address of the router
+     */
+    void setRouterIp(Ip4Address routerIp);
+}
\ No newline at end of file
diff --git a/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisRouterListener.java b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisRouterListener.java
new file mode 100644
index 0000000..7c53a9d
--- /dev/null
+++ b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/IsisRouterListener.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.isis.controller;
+
+/**
+ * Abstraction of an ISIS Router Listener.
+ * Allows for providers interested in switch events to be notified.
+ */
+public interface IsisRouterListener {
+
+    /**
+     * Notifies that a router is added.
+     *
+     * @param isisRouter ISIS router instance
+     */
+    void routerAdded(IsisRouter isisRouter);
+
+    /**
+     * Notifies that a router is removed.
+     *
+     * @param isisRouter ISIS router instance
+     */
+    void routerRemoved(IsisRouter isisRouter);
+
+    /**
+     * Notifies that the router has changed in some way.
+     *
+     * @param isisRouter ISIS router instance
+     */
+    void routerChanged(IsisRouter isisRouter);
+}
\ No newline at end of file
diff --git a/protocols/isis/api/src/main/java/org/onosproject/isis/controller/package-info.java b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/package-info.java
new file mode 100644
index 0000000..8c9504a
--- /dev/null
+++ b/protocols/isis/api/src/main/java/org/onosproject/isis/controller/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Implementation of the ISIS controller.
+ */
+package org.onosproject.isis.controller;
\ No newline at end of file
diff --git a/protocols/isis/pom.xml b/protocols/isis/pom.xml
new file mode 100644
index 0000000..189d298
--- /dev/null
+++ b/protocols/isis/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-protocols</artifactId>
+        <version>1.6.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-isis</artifactId>
+    <packaging>pom</packaging>
+
+    <description>ONOS ISIS Protocol subsystem</description>
+
+    <modules>
+        <module>api</module>
+    </modules>
+
+</project>
diff --git a/protocols/pom.xml b/protocols/pom.xml
index 4820f53..12fbc29 100644
--- a/protocols/pom.xml
+++ b/protocols/pom.xml
@@ -39,6 +39,7 @@
         <module>bgp</module>
         <module>rest</module>
         <module>ospf</module>
+        <module>isis</module>
     </modules>
 
     <dependencies>