summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip-neighbor/ip_neighbor.api
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-09-30 10:53:31 +0000
committerOle Trøan <otroan@employees.org>2019-12-17 10:56:20 +0000
commitcbe25aab3be72154f2c706c39eeba6a77f34450f (patch)
tree131fb53b5ec973be045ffb9e2eb797af01d112a0 /src/vnet/ip-neighbor/ip_neighbor.api
parent96453fd2417ebd1d69354a7fb692976129cea80e (diff)
ip: Protocol Independent IP Neighbors
Type: feature - ip-neighbour: generic neighbour handling; APIs, DBs, event handling, aging - arp: ARP protocol implementation - ip6-nd; IPv6 neighbor discovery implementation; separate ND, MLD, RA - ip6-link; manage link-local addresses - l2-arp-term; events separated from IP neighbours, since they are not the same. vnet retains just enough education to perform ND/ARP packet construction. arp and ip6-nd to be moved to plugins soon. Change-Id: I88dedd0006b299344f4c7024a0aa5baa6b9a8bbe Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip-neighbor/ip_neighbor.api')
-rw-r--r--src/vnet/ip-neighbor/ip_neighbor.api168
1 files changed, 168 insertions, 0 deletions
diff --git a/src/vnet/ip-neighbor/ip_neighbor.api b/src/vnet/ip-neighbor/ip_neighbor.api
new file mode 100644
index 00000000000..a8fb24a712c
--- /dev/null
+++ b/src/vnet/ip-neighbor/ip_neighbor.api
@@ -0,0 +1,168 @@
+/* Hey Emacs use -*- mode: C -*- */
+/*
+ * Copyright (c) 2018 Cisco and/or its affiliates.
+ * 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.
+ */
+
+/** \file
+
+ This file defines vpp IP neighbor control-plane API messages which are generally
+ called through a shared memory interface.
+*/
+
+option version = "1.0.0";
+
+import "vnet/ip/ip_types.api";
+import "vnet/ethernet/ethernet_types.api";
+import "vnet/interface_types.api";
+
+/** \brief IP neighbor flags
+ @param is_static - A static neighbor Entry - there are not flushed
+ If the interface goes down.
+ @param is_no_fib_entry - Do not create a corresponding entry in the FIB
+ table for the neighbor.
+*/
+enum ip_neighbor_flags: u8
+{
+ IP_API_NEIGHBOR_FLAG_NONE = 0,
+ IP_API_NEIGHBOR_FLAG_STATIC = 0x1,
+ IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY = 0x2,
+};
+
+/** \brief IP neighbor
+ @param sw_if_index - interface used to reach neighbor
+ @param flags - flags for the nieghbor
+ @param mac_address - l2 address of the neighbor
+ @param ip_address - ip4 or ip6 address of the neighbor
+*/
+typedef ip_neighbor {
+ vl_api_interface_index_t sw_if_index;
+ vl_api_ip_neighbor_flags_t flags;
+ vl_api_mac_address_t mac_address;
+ vl_api_address_t ip_address;
+};
+
+/** \brief IP neighbor add / del request
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param is_add - 1 to add neighbor, 0 to delete
+ @param neighbor - the neighor to add/remove
+*/
+define ip_neighbor_add_del
+{
+ u32 client_index;
+ u32 context;
+ /* 1 = add, 0 = delete */
+ bool is_add;
+ vl_api_ip_neighbor_t neighbor;
+};
+/** \brief IP neighbor add / del reply
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param retval - return value
+ @param stats_index - the index to use for this neighbor in the stats segement
+*/
+define ip_neighbor_add_del_reply
+{
+ u32 context;
+ i32 retval;
+ u32 stats_index;
+};
+
+/** \brief Dump IP neighboors
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param sw_if_index - the interface to dump neighboors, ~0 == all
+ @param af - address family is ipv[6|4]
+*/
+define ip_neighbor_dump
+{
+ u32 client_index;
+ u32 context;
+ vl_api_interface_index_t sw_if_index [default=0xffffffff];
+ vl_api_address_family_t af;
+};
+
+/** \brief IP neighboors dump response
+ @param context - sender context which was passed in the request
+ @param neighbour - the neighbor
+*/
+define ip_neighbor_details {
+ u32 context;
+ vl_api_ip_neighbor_t neighbor;
+};
+
+/** \brief Enable/disable periodic IP neighbor scan
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param af - Address family v4/v6
+ @param max_number - The maximum number of neighbours that will be created.
+ default 50k
+ @param max_age - The maximum age (in seconds) before an inactive neighbour
+ is flushed
+ default 0 => never
+ @param recycle - If max_number of neighbours is reached and new ones need
+ to be created should the oldest neighbour be 'recycled'.
+*/
+autoreply define ip_neighbor_config
+{
+ u32 client_index;
+ u32 context;
+ vl_api_address_family_t af;
+ u32 max_number;
+ u32 max_age;
+ bool recycle;
+};
+
+/** \brief Register for IP4 ARP resolution event on receing ARP reply or
+ MAC/IP info from ARP requests in L2 BDs
+ @param client_index - opaque cookie to identify the sender
+ @param context - sender context, to match reply w/ request
+ @param enable - 1 => register for events, 0 => cancel registration
+ @param pid - sender's pid
+ @param ip - exact IP address of interested neighbor resolution event
+ @param sw_if_index - interface on which the IP address is present.
+*/
+autoreply define want_ip_neighbor_events
+{
+ u32 client_index;
+ u32 context;
+ bool enable;
+ u32 pid;
+ vl_api_address_t ip;
+ vl_api_interface_index_t sw_if_index [default=0xffffffff];
+};
+
+/** \brief Tell client about an IP4 ARP resolution event or
+ MAC/IP info from ARP requests in L2 BDs
+ @param client_index - opaque cookie to identify the sender
+ @param pid - client pid registered to receive notification
+ @param neighbor - new neighbor created
+*/
+define ip_neighbor_event
+{
+ u32 client_index;
+ u32 pid;
+ vl_api_ip_neighbor_t neighbor;
+};
+
+service {
+ rpc want_ip_neighbor_events returns want_ip_neighbor_events_reply
+ events ip_neighbor_event;
+};
+
+/*
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */
color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
{
  "vpp_details": {
    "program": "vpe",
    "version": "18.10-release",
    "build_date": "Tue Oct 23 07:03:38 UTC 2018",
    "build_directory": "/w/workspace/vpp-merge-1810-centos7"
  },
  "interfaces": [
    {
      "if_index": 0,
      "if_name": "local0",
      "if_tag": "",
      "if_mac": "",
      "if_admin_state": 0,
      "if_link_state": 0,
      "if_link_mtu": 0,
      "if_sub_dot1ad": 0,
      "if_sub_id": 0,
      "if_tx_bytes": 0,
      "if_tx_packets": 0,
      "if_tx_errors": 0,
      "if_rx_bytes": 0,
      "if_rx_packets": 0,
      "if_rx_errors": 0,
      "if_drops": 0,
      "if_punts": 0
    },
    {
      "if_index": 1,
      "if_name": "TenGigabitEthernet5e/0/2",
      "if_tag": "",
      "if_mac": "11:33:55:77:99:aa",
      "if_admin_state": 1,
      "if_link_state": 1,
      "if_link_mtu": 9202,
      "if_sub_dot1ad": 0,
      "if_sub_id": 0,
      "if_tx_bytes": 5024976,
      "if_tx_packets": 40524,
      "if_tx_errors": 0,
      "if_rx_bytes": 200094228,
      "if_rx_packets": 1685702,
      "if_rx_errors": 0,
      "if_drops": 1214356,
      "if_punts": 0
    },
    {
      "if_index": 2,
      "if_name": "TenGigabitEthernet5e/0/3",
      "if_tag": "",
      "if_mac": "11:33:55:77:99:aa",
      "if_admin_state": 1,
      "if_link_state": 1,
      "if_link_mtu": 9202,
      "if_sub_dot1ad": 0,
      "if_sub_id": 0,
      "if_tx_bytes": 5024976,
      "if_tx_packets": 40524,
      "if_tx_errors": 0,
      "if_rx_bytes": 233044788,
      "if_rx_packets": 2257762,
      "if_rx_errors": 0,
      "if_drops": 1214348,
      "if_punts": 0
    },
    {
      "if_index": 3,
      "if_name": "BondEthernet0",
      "if_tag": "net-vpp.physnet:physnet1",
      "if_mac": "11:33:55:77:99:bb",
      "if_admin_state": 1,
      "if_link_state": 1,
      "if_link_mtu": 9216,
      "if_sub_dot1ad": 0,
      "if_sub_id": 0,
      "if_tx_bytes": 0,
      "if_tx_packets": 0,
      "if_tx_errors": 0,
      "if_rx_bytes": 0,
      "if_rx_packets": 0,
      "if_rx_errors": 0,
      "if_drops": 1514852,
      "if_punts": 0
    },
    {
      "if_index": 4,
      "if_name": "BondEthernet0.549",
      "if_tag": "net-vpp.uplink:physnet1.vlan.549",
      "if_mac": "",
      "if_admin_state": 1,
      "if_link_state": 1,
      "if_link_mtu": 9216,
      "if_sub_dot1ad": 0,
      "if_sub_id": 549,
      "if_tx_bytes": 0,
      "if_tx_packets": 0,
      "if_tx_errors": 0,
      "if_rx_bytes": 1968,
      "if_rx_packets": 26,
      "if_rx_errors": 0,
      "if_drops": 78,
      "if_punts": 0
    },
    {
      "if_index": 5,
      "if_name": "VirtualEthernet0/0/0",
      "if_tag": "net-vpp.port:fb9b1ce8-f643-45be-9298-ccd18f9018c8",
      "if_mac": "dd:ff:11:33:55:77",
      "if_admin_state": 1,
      "if_link_state": 0,
      "if_link_mtu": 9216,
      "if_sub_dot1ad": 0,
      "if_sub_id": 0,
      "if_tx_bytes": 0,
      "if_tx_packets": 0,
      "if_tx_errors": 26,
      "if_rx_bytes": 0,
      "if_rx_packets": 0,
      "if_rx_errors": 0,
      "if_drops": 0,
      "if_punts": 0
    },
    {
      "if_index": 6,
      "if_name": "BondEthernet0.529",
      "if_tag": "net-vpp.uplink:physnet1.vlan.529",
      "if_mac": "",
      "if_admin_state": 1,
      "if_link_state": 1,
      "if_link_mtu": 9216,
      "if_sub_dot1ad": 0,
      "if_sub_id": 529,
      "if_tx_bytes": 0,
      "if_tx_packets": 0,
      "if_tx_errors": 0,
      "if_rx_bytes": 0,
      "if_rx_packets": 0,
      "if_rx_errors": 0,
      "if_drops": 0,
      "if_punts": 0
    },
    {
      "if_index": 7,
      "if_name": "VirtualEthernet0/0/1",
      "if_tag": "net-vpp.port:bc726b1c-526e-4a8d-9f9a-c19b5dfe2b28",
      "if_mac": "22:44:66:88:aa:cc",
      "if_admin_state": 1,
      "if_link_state": 0,
      "if_link_mtu": 9216,
      "if_sub_dot1ad": 0,
      "if_sub_id": 0,
      "if_tx_bytes": 0,
      "if_tx_packets": 0,
      "if_tx_errors": 0,
      "if_rx_bytes": 0,
      "if_rx_packets": 0,
      "if_rx_errors": 0,
      "if_drops": 0,
      "if_punts": 0
    },
    {
      "if_index": 8,
      "if_name": "VirtualEthernet0/0/2",
      "if_tag": "net-vpp.port:aaabbbcc-a86d-4eb5-a3bc-aaabbbcccddd",
      "if_mac": "12:34:56:78:9a:bc",
      "if_admin_state": 1,
      "if_link_state": 0,
      "if_link_mtu": 9216,
      "if_sub_dot1ad": 0,
      "if_sub_id": 0,
      "if_tx_bytes": 0,
      "if_tx_packets": 0,
      "if_tx_errors": 26,
      "if_rx_bytes": 0,
      "if_rx_packets": 0,
      "if_rx_errors": 0,
      "if_drops": 0,
      "if_punts": 0
    },
    {
      "if_index": 9,
      "if_name": "VirtualEthernet0/0/3",
      "if_tag": "net-vpp.port:dddeeeff-838e-4995-9bd2-eeefff000111",
      "if_mac": "fe:dc:ba:98:76:54",
      "if_admin_state": 1,
      "if_link_state": 0,
      "if_link_mtu": 9216,
      "if_sub_dot1ad": 0,
      "if_sub_id": 0,
      "if_tx_bytes": 0,
      "if_tx_packets": 0,
      "if_tx_errors": 26,
      "if_rx_bytes": 0,
      "if_rx_packets": 0,
      "if_rx_errors": 0,
      "if_drops": 0,
      "if_punts": 0
    }
  ]
}