aboutsummaryrefslogtreecommitdiffstats
path: root/utils/sysrepo-plugins/yang/hicn
diff options
context:
space:
mode:
Diffstat (limited to 'utils/sysrepo-plugins/yang/hicn')
-rw-r--r--utils/sysrepo-plugins/yang/hicn/hicn.yang571
-rw-r--r--utils/sysrepo-plugins/yang/hicn/rpc_call_samples.xml78
-rw-r--r--utils/sysrepo-plugins/yang/hicn/sysrepo_startup.xml11
3 files changed, 660 insertions, 0 deletions
diff --git a/utils/sysrepo-plugins/yang/hicn/hicn.yang b/utils/sysrepo-plugins/yang/hicn/hicn.yang
new file mode 100644
index 000000000..e5bdca420
--- /dev/null
+++ b/utils/sysrepo-plugins/yang/hicn/hicn.yang
@@ -0,0 +1,571 @@
+module hicn {
+namespace "urn:sysrepo:hicn";
+prefix hcn;
+
+revision 2019-04-25 {
+ description "Initial revision.";
+}
+
+/* new data types and grouping definition to forward the remote request toward hicn controler--to-->hicn */
+
+typedef float {
+ type decimal64 {
+ fraction-digits 2;
+ }
+}
+
+
+grouping params {
+
+leaf enable_disable {
+ description "Enable / disable ICN forwarder in VPP.";
+ type boolean;
+ default false;
+ }
+
+leaf pit_max_size {
+ description "PIT maximum size, otherwise -1 to assign default value.";
+ type int32;
+ default -1;
+ }
+
+leaf cs_max_size {
+ description "CS maximum size, otherwise -1 to assign default value.";
+ type int32;
+ default -1;
+ }
+
+leaf cs_reserved_app {
+ description "Portion of CS reserved to application, otherwise -1 to assign default value.";
+ type int32;
+ default -1;
+ }
+
+leaf pit_dflt_lifetime_sec {
+ description "Default PIT entry lifetime, otherwise -1 to assign default value.";
+ type float;
+ default -1;
+ }
+
+leaf pit_max_lifetime_sec {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value.";
+ type float;
+ default -1;
+ }
+
+leaf pit_min_lifetime_sec {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type float;
+ default -1;
+ }
+}
+
+grouping face_ip_add {
+
+leaf lip4 {
+ description "IP version 4 local address.";
+ type string;
+ }
+
+leaf lip6 {
+ description "IP version 6 local address.";
+ type string;
+ }
+
+leaf rip4 {
+ description "IP version 4 local address.";
+ type string;
+ }
+
+leaf rip6 {
+ description "IP version 6 local address.";
+ type string;
+ }
+
+leaf swif {
+ description "Interface Index.";
+ type uint32;
+ }
+}
+
+grouping route_nhops_add {
+
+leaf ip4 {
+ description "ip4 to be added to the FIB.";
+ type string;
+ }
+
+leaf ip6 {
+ description "ip6 to be added to the FIB.";
+ type string;
+ }
+
+leaf len {
+ description "Length of the prefix.";
+ type uint8;
+ }
+
+leaf face_ids0 {
+ description "A Face ID to the next hop forwarder for the specified prefix.";
+ type uint32;
+ }
+
+leaf face_ids1 {
+ description "A Face ID to the next hop forwarder for the specified prefix.";
+ type uint32;
+ }
+
+leaf face_ids2 {
+ description "A Face ID to the next hop forwarder for the specified prefix.";
+ type uint32;
+ }
+
+leaf face_ids3 {
+ description "A Face ID to the next hop forwarder for the specified prefix.";
+ type uint32;
+ }
+
+leaf face_ids4 {
+ description "A Face ID to the next hop forwarder for the specified prefix.";
+ type uint32;
+ }
+
+leaf face_ids5 {
+ description "A Face ID to the next hop forwarder for the specified prefix.";
+ type uint32;
+ }
+
+leaf face_ids6 {
+ description "A Face ID to the next hop forwarder for the specified prefix.";
+ type uint32;
+ }
+
+leaf n_faces {
+ description "Number of face to add.";
+ type uint8;
+ }
+}
+
+
+grouping route_nhops_del {
+
+leaf ip4 {
+ description "ip4 to be added to the FIB.";
+ type string;
+ }
+
+leaf ip6 {
+ description "ip6 to be added to the FIB.";
+ type string;
+ }
+
+leaf len {
+ description "Length of the prefix.";
+ type uint8;
+ }
+
+leaf faceid {
+ description "A Face ID to the next hop forwarder for the specified prefix.";
+ type uint32;
+ }
+
+}
+
+grouping route_del {
+
+leaf ip4 {
+ description "ip4 to be added to the FIB.";
+ type string;
+ }
+
+leaf ip6 {
+ description "ip6 to be added to the FIB.";
+ type string;
+ }
+
+leaf len {
+ description "Length of the prefix.";
+ type uint8;
+ }
+}
+
+
+grouping route_get {
+
+
+leaf ip4 {
+ description "ip4 to be added to the FIB.";
+ type string;
+ }
+
+leaf ip6 {
+ description "ip6 to be added to the FIB.";
+ type string;
+ }
+
+leaf len {
+ description "Length of the prefix.";
+ type uint8;
+ }
+}
+
+grouping punting_add {
+
+leaf ip4 {
+ description "ip4 to be added to the FIB.";
+ type string;
+ }
+
+leaf ip6 {
+ description "ip6 to be added to the FIB.";
+ type string;
+ }
+
+leaf len {
+ description "Length of the prefix.";
+ type uint8;
+ }
+
+leaf swif {
+ description "Interface id.";
+ type uint32;
+ }
+}
+
+grouping register_prod_app {
+
+leaf-list prefix {
+ description "prefix to be matched to the FIB.";
+ type uint64;
+ }
+
+leaf len {
+ description "Length of the prefix.";
+ type uint8;
+ }
+
+leaf swif {
+ description "Interface id.";
+ type uint32;
+ }
+
+leaf cs_reserved {
+ description "CS memory reserved -- in number of packets.";
+ type uint32;
+ }
+
+}
+
+/* new data types and grouping definition to backward the remote response hicn--to-->controler */
+
+
+grouping states-reply {
+
+ leaf pkts_processed {
+ description "ICN packets processed.";
+ type uint64;
+ }
+
+ leaf pkts_interest_count {
+ description "PIT maximum size, otherwise -1 to assign default value.";
+ type uint64;
+ }
+
+ leaf pkts_data_count {
+ description "CS maximum size, otherwise -1 to assign default value.";
+ type uint64;
+ }
+
+ leaf pkts_from_cache_count {
+ description "Portion of CS reserved to application, otherwise -1 to assign default value.";
+ type uint64;
+ }
+
+ leaf pkts_no_pit_count {
+ description "Default PIT entry lifetime, otherwise -1 to assign default value.";
+ type uint64;
+ }
+
+ leaf pit_expired_count {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value.";
+ type uint64;
+ }
+
+ leaf cs_expired_count {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf cs_lru_count {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf pkts_drop_no_buf {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf interests_aggregated {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf interests_retx {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf interests_hash_collision {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf pit_entries_count {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf cs_entries_count {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf cs_entries_ntw_count {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+}
+
+grouping face-stats-reply {
+ list face{
+ key faceid;
+ leaf faceid {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint32;
+ }
+
+ leaf intfc {
+ description "This is the idx number of the faceid.";
+ type uint32;
+ }
+
+ leaf irx_packets {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf irx_bytes {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf itx_packets {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf itx_bytes {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+
+ leaf drx_packets {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf drx_bytes {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+ leaf dtx_packets {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+
+
+ leaf dtx_bytes {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint64;
+ }
+ }
+}
+
+grouping strategy-reply {
+
+ leaf description {
+ description "Enable / disable ICN forwarder in VPP.";
+ type uint8;
+ }
+}
+
+grouping route-reply {
+
+ leaf faceids {
+ description "Enable / disable ICN forwarder in VPP.";
+ type uint32;
+
+ }
+
+ leaf strategy_id {
+ description "compile-time plugin features.";
+ type uint32;
+ }
+}
+
+grouping strategies-reply {
+ leaf n_strategies {
+ description "Enable / disable ICN forwarder in VPP.";
+ type uint8;
+ }
+ leaf strategy_id {
+ description "Enable / disable ICN forwarder in VPP.";
+ type uint32;
+ }
+
+}
+
+/* Hicn configuration */
+
+container hicn-conf {
+ description "config data container for the hicn-vpp.";
+ container params{
+ uses params;
+ }
+}
+
+
+/* Hicn operational data */
+
+container hicn-state {
+ config false;
+ description "operational data container for the hicn.";
+
+ container states{
+ uses states-reply;
+ }
+ container routes{
+ uses route-reply;
+ }
+ container strategies{
+ uses strategies-reply;
+ }
+ container faces{
+ uses face-stats-reply;
+ }
+
+}
+
+/* RPC Definitions */
+
+
+rpc node-params-set {
+ description "Operation to set hicn params in vpp.";
+ input {
+ uses params;
+ }
+}
+
+rpc node-params-get {
+ description "Operation to get hicn parameter in vpp.";
+}
+
+
+rpc node-stat-get {
+ description "Operation to get hicn status in vpp.";
+}
+
+
+rpc strategy-get {
+ description "Operation to get hicn strategy.";
+ input {
+ leaf strategy_id {
+ description "Upper bound on PIT entry lifetime, otherwise -1 to assign default value .";
+ type uint32;
+ }
+ }
+}
+
+rpc strategies-get {
+ description "Operation to get hicn strategies.";
+}
+
+rpc route-get {
+ description "Operation to get hicn route.";
+ input {
+ uses route_get;
+ }
+}
+
+rpc route-del {
+ description "Operation to del hicn route.";
+ input {
+ uses route_del;
+ }
+}
+
+rpc route-nhops-add {
+ description "Operation to add hicn route nhops.";
+ input {
+ uses route_nhops_add;
+ }
+}
+
+rpc route-nhops-del {
+ description "Operation to add hicn face ip punt.";
+ input {
+ uses route_nhops_del;
+ }
+}
+
+rpc face-ip-params-get {
+ description "Operation to del hicn route.";
+ input {
+ leaf faceid {
+ description "Face to be retrieved .";
+ type uint32;
+ }
+ }
+}
+
+rpc face-ip-add {
+ description "Operation to add hicn face ip.";
+ input {
+ uses face_ip_add;
+ }
+}
+
+rpc face-ip-del {
+ description "Operation to del hicn face ip.";
+ input {
+ leaf faceid {
+ description "Face to be deleted .";
+ type uint32;
+ }
+ }
+}
+
+rpc punting-add {
+ description "Operation to add hicn punt.";
+ input {
+ uses punting_add;
+ }
+}
+
+rpc punting-del {
+ description "Operation to del hicn punt.";
+ input {
+ uses punting_add; /* It uses the same payload as the add*/
+ }
+}
+
+rpc face-stats-details {
+ description "Operation to take stat per face.";
+}
+
+
+} \ No newline at end of file
diff --git a/utils/sysrepo-plugins/yang/hicn/rpc_call_samples.xml b/utils/sysrepo-plugins/yang/hicn/rpc_call_samples.xml
new file mode 100644
index 000000000..db79fd4ef
--- /dev/null
+++ b/utils/sysrepo-plugins/yang/hicn/rpc_call_samples.xml
@@ -0,0 +1,78 @@
+<node-params-get xmlns="urn:sysrepo:hicn"/>
+
+<node-stat-get xmlns="urn:sysrepo:hicn"/>
+
+<strategy-get xmlns="urn:sysrepo:hicn">
+ <strategy_id>0</strategy_id>
+</strategy-get>
+
+<strategies-get xmlns="urn:sysrepo:hicn"/>
+
+
+<route-get xmlns="urn:sysrepo:hicn">
+ <ip4>192.168.1.1</ip4>
+ <ip6>-1</ip6>
+ <len>24</len>
+</route-get>
+
+<route-del xmlns="urn:sysrepo:hicn">
+ <ip4>192.168.1.1</ip4>
+ <ip6>-1</ip6>
+ <len>30</len>
+</route-del>
+
+<route-nhops-add xmlns="urn:sysrepo:hicn">
+ <ip4>192.168.1.1</ip4>
+ <ip6>-1</ip6>
+ <len>24</len>
+ <face_ids0>0</face_ids0>
+ <face_ids1>0</face_ids1>
+ <face_ids2>0</face_ids2>
+ <face_ids3>0</face_ids3>
+ <face_ids4>0</face_ids4>
+ <face_ids5>0</face_ids5>
+ <face_ids6>0</face_ids6>
+ <n_faces>1</n_faces>
+</route-nhops-add>
+
+<route-nhops-del xmlns="urn:sysrepo:hicn">
+ <ip4>192.168.1.1</ip4>
+ <ip6>-1</ip6>
+ <len>24</len>
+ <faceid>0</faceid>
+</route-nhops-del>
+
+
+<face-ip-params-get xmlns="urn:sysrepo:hicn">
+ <faceid>10</faceid>
+</face-ip-params-get>
+
+<face-ip-add xmlns="urn:sysrepo:hicn">
+ <lip4>192.168.1.10</lip4>
+ <lip6>-1</lip6>
+ <rip4>192.168.1.1</rip4>
+ <rip6>-1</rip6>
+ <swif>0</swif>
+</face-ip-add>
+
+
+<face-ip-del xmlns="urn:sysrepo:hicn">
+ <faceid>0</faceid>
+</face-ip-del>
+
+<punting-add xmlns="urn:sysrepo:hicn">
+ <ip4>192.168.0.1</ip4>
+ <ip6>-1</ip6>
+ <len>24</len>
+ <swif>0</swif>
+</punting-add>
+
+
+<punting-del xmlns="urn:sysrepo:hicn">
+ <ip4>192.168.0.1</ip4>
+ <ip6>-1</ip6>
+ <len>24</len>
+ <swif>0</swif>
+</punting-del>
+
+<face-stats-details xmlns="urn:sysrepo:hicn"/>
diff --git a/utils/sysrepo-plugins/yang/hicn/sysrepo_startup.xml b/utils/sysrepo-plugins/yang/hicn/sysrepo_startup.xml
new file mode 100644
index 000000000..f88e13ea2
--- /dev/null
+++ b/utils/sysrepo-plugins/yang/hicn/sysrepo_startup.xml
@@ -0,0 +1,11 @@
+<hicn-conf xmlns="urn:sysrepo:hicn">
+<params>
+ <enable_disable>false</enable_disable>
+ <pit_max_size>-1</pit_max_size>
+ <cs_max_size>-1</cs_max_size>
+ <cs_reserved_app>-1</cs_reserved_app>
+ <pit_dflt_lifetime_sec>-1</pit_dflt_lifetime_sec>
+ <pit_max_lifetime_sec>-1</pit_max_lifetime_sec>
+ <pit_min_lifetime_sec>-1</pit_min_lifetime_sec>
+</params>
+</hicn-conf> \ No newline at end of file