summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/l2_input.c
AgeCommit message (Expand)AuthorFilesLines
2018-03-29l2_input:optimize counter accessEyal Bari1-31/+16
2018-02-07classifier-based ACL: refactor + add output ACLAndrew Yourtchenko1-2/+1
2017-11-10Further fix to SHG handling for ARP/ICMPv6 from BVI in a BDJohn Lo1-6/+25
2017-11-08Fix SHG handling for ARP/ICMPv6 received from BVI in a BDJohn Lo1-0/+8
2017-10-31l2fib: MAC: Fix uint64 to u8 byte arrayMohsin Kazmi1-5/+2
2017-10-03Update L2FIB entry timestamp only if BD aging enabled (VPP-1002)John Lo1-0/+1
2017-07-31CLI:add l2 input/outut to "sh int features"Eyal Bari1-0/+23
2017-07-23Improve L2 Input/Output Feature Infrastructure and UsageJohn Lo1-20/+17
2017-07-20L2FWD:move vec_validate out of access functionEyal Bari1-1/+1
2017-07-13Fix crash with worker threads on 4K VXLAN/BD setup (VPP-907)John Lo1-25/+24
2017-06-27L2-LEARN:fix l2fib entry seq num not updated on hit (VPP-888)Eyal Bari1-1/+1
2017-06-19L2FWD:fix seq_num overwritten + validate l2fib entries when forwardingEyal Bari1-2/+2
2017-05-19Enforce Bridge Domain ID range to match 24-bit VNI rangeJohn Lo1-0/+6
2017-05-08L2FIB:CLI/API to flush all non-static entriesEyal Bari1-5/+8
2017-05-03L2FIB:flush interface learned macs on downEyal Bari1-28/+14
2017-04-06Use thread local storage for thread indexDamjan Marion1-7/+7
2017-03-28Implement MAC Flush for BD or Interface from the L2FIBJohn Lo1-0/+14
2017-03-03VPP-651: Ensure sw_if_index to node mapping for L2 output path is only done v...Andrew Yourtchenko1-1/+2
2017-02-28Clear L2 output config on interface mode change to L3 (VPP-651)John Lo1-4/+11
2017-02-17l2 input: avoid per-packet trace checks in the fast pathDave Barach1-7/+14
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion1-0/+1116
='#n431'>431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611
/*
 * Copyright (c) 2016 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 control-plane API messages which are generally
    called through a shared memory interface. 
*/

/** \brief Dump IP fib table
    @param client_index - opaque cookie to identify the sender
*/
define ip_fib_dump
{
  u32 client_index;
  u32 context;
};

/** \brief FIB path
    @param sw_if_index - index of the interface
    @param weight - The weight, for UCMP
    @param is_local - local if non-zero, else remote
    @param is_drop - Drop the packet
    @param is_unreach - Drop the packet and rate limit send ICMP unreachable
    @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
    @param afi - the afi of the next hop, IP46_TYPE_IP4=1, IP46_TYPE_IP6=2
    @param next_hop[16] - the next hop address

    WARNING: this type is replicated, pending cleanup completion
*/
typeonly manual_print manual_endian define fib_path
{
  u32 sw_if_index;
  u32 weight;
  u8 is_local;
  u8 is_drop;
  u8 is_unreach;
  u8 is_prohibit;
  u8 afi;
  u8 next_hop[16];
};

/** \brief IP FIB table response
    @param table_id - IP fib table id
    @address_length - mask length
    @address - ip4 prefix
    @param count - the number of fib_path in path
    @param path  - array of of fib_path structures
*/
manual_endian manual_print define ip_fib_details
{
  u32 context;
  u32 table_id;
  u8  address_length;
  u8  address[4];
  u32 count;
  vl_api_fib_path_t path[count];
};

/** \brief Dump IP6 fib table
    @param client_index - opaque cookie to identify the sender
*/
define ip6_fib_dump
{
  u32 client_index;
  u32 context;
};

/** \brief IP6 FIB table response
    @param table_id - IP6 fib table id
    @address_length - mask length
    @address - ip6 prefix
    @param count - the number of fib_path in path
    @param path  - array of of fib_path structures
*/
manual_endian manual_print define ip6_fib_details
{
  u32 context;
  u32 table_id;
  u8  address_length;
  u8  address[16];
  u32 count;
  vl_api_fib_path_t path[count];
};

/** \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
    @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
*/
define ip_neighbor_dump
{
    u32 client_index;
    u32 context;
    u32 sw_if_index;
    u8  is_ipv6;
};

/** \brief IP neighboors dump response
    @param context - sender context which was passed in the request
    @param is_static - [1|0] to indicate if neighbor is statically configured
    @param is_ipv6 - [1|0] to indicate if address family is ipv[6|4]
*/
define ip_neighbor_details {
    u32 context;
    u8  is_static;
    u8  is_ipv6;
    u8  mac_address[6];
    u8  ip_address[16];
};

/** \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 sw_if_index - interface used to reach neighbor
    @param is_add - 1 to add neighbor, 0 to delete
    @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
    @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
    @param is_static - A static neighbor Entry - there are not flushed
                       If the interface goes down.
    @param is_no_adj_fib - Do not create a corresponding entry in the FIB
                           table for the neighbor.
    @param mac_address - l2 address of the neighbor
    @param dst_address - ip4 or ip6 address of the neighbor
*/
define ip_neighbor_add_del
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  /* 1 = add, 0 = delete */
  u8 is_add;
  u8 is_ipv6;
  u8 is_static;
  u8 is_no_adj_fib;
  u8 mac_address[6];
  u8 dst_address[16];
};

/** \brief Reply for IP Neighbor add / delete request
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define ip_neighbor_add_del_reply
{
  u32 context;
  i32 retval;
};

/** \brief Set the ip flow hash config for a fib request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param vrf_id - vrf/fib id
    @param is_ipv6 - if non-zero the fib is ip6, else ip4
    @param src - if non-zero include src in flow hash
    @param dst - if non-zero include dst in flow hash
    @param sport - if non-zero include sport in flow hash
    @param dport - if non-zero include dport in flow hash
    @param proto -if non-zero include proto in flow hash
    @param reverse - if non-zero include reverse in flow hash
*/
define set_ip_flow_hash
{
  u32 client_index;
  u32 context;
  u32 vrf_id;
  u8 is_ipv6;
  u8 src;
  u8 dst;
  u8 sport;
  u8 dport;
  u8 proto;
  u8 reverse;
};

/** \brief Set the ip flow hash config for a fib response
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
*/
define set_ip_flow_hash_reply
{
  u32 context;
  i32 retval;
};

/** \brief IPv6 router advertisement config request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param suppress -
    @param managed -
    @param other -
    @param ll_option -
    @param send_unicast -
    @param cease -
    @param is_no -
    @param default_router -
    @param max_interval -
    @param min_interval -
    @param lifetime -
    @param initial_count -
    @param initial_interval -
*/
define sw_interface_ip6nd_ra_config
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 suppress;
  u8 managed;
  u8 other;
  u8 ll_option;
  u8 send_unicast;
  u8 cease;
  u8 is_no;
  u8 default_router;
  u32 max_interval;
  u32 min_interval;
  u32 lifetime;
  u32 initial_count;
  u32 initial_interval;
};

/** \brief IPv6 router advertisement config response
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
*/
define sw_interface_ip6nd_ra_config_reply
{
  u32 context;
  i32 retval;
};

/** \brief IPv6 router advertisement prefix config request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - The interface the RA prefix information is for
    @param address[] - The prefix to advertise
    @param address_length - the prefix length
    @param use_default - Revert to default settings
    @param no_advertise - Do not advertise this prefix
    @param off_link - The prefix is off link (it is not configured on the interface)
                      Configures the L-flag, When set, indicates that this
		      prefix can be used for on-link determination.
    @param no_autoconfig - Setting for the A-flag. When
                           set indicates that this prefix can be used for
                          stateless address configuration.
    @param no_onlink - The prefix is not on link. Make sure this is consistent
                       with the off_link parameter else YMMV
    @param is_no - add/delete
    @param val_lifetime - The length of time in
                     seconds (relative to the time the packet is sent)
                     that the prefix is valid for the purpose of on-link
                     determination.  A value of all one bits
                     (0xffffffff) represents infinity
    @param pref_lifetime - The length of time in
                     seconds (relative to the time the packet is sent)
                     that addresses generated from the prefix via
                     stateless address autoconfiguration remain
                     preferred [ADDRCONF].  A value of all one bits
                     (0xffffffff) represents infinity.
*/
define sw_interface_ip6nd_ra_prefix
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 address[16];
  u8 address_length;
  u8 use_default;
  u8 no_advertise;
  u8 off_link;
  u8 no_autoconfig;
  u8 no_onlink;
  u8 is_no;
  u32 val_lifetime;
  u32 pref_lifetime;
};

/** \brief IPv6 router advertisement prefix config response
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
*/
define sw_interface_ip6nd_ra_prefix_reply
{
  u32 context;
  i32 retval;
};

/** \brief IPv6 ND proxy config
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - The interface the host is on
    @param address - The address of the host for which to proxy for
    @param is_add - Adding or deleting
*/
define ip6nd_proxy_add_del
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 is_del;
  u8 address[16];
};

/** \brief IPv6 ND proxy response
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
*/
define ip6nd_proxy_add_del_reply
{
  u32 context;
  i32 retval;
};

/** \brief IPv6 ND proxy details returned after request
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
*/
define ip6nd_proxy_details
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 address[16];
};

/** \brief IPv6 ND proxy dump request
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param sw_if_index - The interface the host is on
    @param address - The address of the host for which to proxy for
*/
define ip6nd_proxy_dump
{
  u32 client_index;
  u32 context;
};

/** \brief IPv6 interface enable / disable request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface used to reach neighbor
    @param enable - if non-zero enable ip6 on interface, else disable
*/
define sw_interface_ip6_enable_disable
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 enable;			/* set to true if enable */
};

/** \brief IPv6 interface enable / disable response
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
*/
define sw_interface_ip6_enable_disable_reply
{
  u32 context;
  i32 retval;
};

/** \brief IPv6 set link local address on interface request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - interface to set link local on
    @param address[] - the new link local address
*/
define sw_interface_ip6_set_link_local_address
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 address[16];
};

/** \brief IPv6 set link local address on interface response
    @param context - sender context, to match reply w/ request
    @param retval - error code for the request
*/
define sw_interface_ip6_set_link_local_address_reply
{
  u32 context;
  i32 retval;
};

/** \brief Add / del route request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - software index of the new vlan's parent interface
    @param vrf_id - fib table /vrf associated with the route
    @param lookup_in_vrf - 
    @param classify_table_index - 
    @param create_vrf_if_needed - 
    @param is_add - 1 if adding the route, 0 if deleting
    @param is_drop - Drop the packet
    @param is_unreach - Drop the packet and rate limit send ICMP unreachable
    @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
    @param is_ipv6 - 0 if an ip4 route, else ip6
    @param is_local - 
    @param is_classify - 
    @param is_multipath - Set to 1 if this is a multipath route, else 0
    @param not_last - Is last or not last msg in group of multiple add/del msgs
    @param next_hop_weight - 
    @param dst_address_length - 
    @param dst_address[16] - 
    @param next_hop_address[16] - 
    @param next_hop_n_out_labels - the number of labels in the label stack
    @param next_hop_out_label_stack - the next-hop output label stack, outer most first
    @param next_hop_via_label - The next-hop is a resolved via a local label
*/
define ip_add_del_route
{
  u32 client_index;
  u32 context;
  u32 next_hop_sw_if_index;
  u32 table_id;
  u32 classify_table_index;
  u32 next_hop_table_id;
  u8 create_vrf_if_needed;
  u8 is_add;
  u8 is_drop;
  u8 is_unreach;
  u8 is_prohibit;
  u8 is_ipv6;
  u8 is_local;
  u8 is_classify;
  u8 is_multipath;
  u8 is_resolve_host;
  u8 is_resolve_attached;
  /* Is last/not-last message in group of multiple add/del messages. */
  u8 not_last;
  u8 next_hop_weight;
  u8 dst_address_length;
  u8 dst_address[16];
  u8 next_hop_address[16];
  u8 next_hop_n_out_labels;
  u32 next_hop_via_label;
  u32 next_hop_out_label_stack[next_hop_n_out_labels];
};

/** \brief Reply for add / del route request
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define ip_add_del_route_reply
{
  u32 context;
  i32 retval;
};

/** \brief Add / del route request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - software index of the new vlan's parent interface
    @param vrf_id - fib table /vrf associated with the route

    FIXME
*/
define ip_mroute_add_del
{
  u32 client_index;
  u32 context;
  u32 next_hop_sw_if_index;
  u32 table_id;
  u32 entry_flags;
  u32 itf_flags;
  u16 grp_address_length;
  u8 create_vrf_if_needed;
  u8 is_add;
  u8 is_ipv6;
  u8 is_local;
  u8 grp_address[16];
  u8 src_address[16];
};

/** \brief Reply for add / del mroute request
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define ip_mroute_add_del_reply
{
  u32 context;
  i32 retval;
};

/** \brief Dump IP multicast fib table
    @param client_index - opaque cookie to identify the sender
*/
define ip_mfib_dump
{
  u32 client_index;
  u32 context;
};

/** \brief IP Multicast FIB table response
    @param table_id - IP fib table id
    @address_length - mask length
    @grp_address - Group address/prefix
    @src_address - Source address
    @param count - the number of fib_path in path
    @param path  - array of of fib_path structures
*/
manual_endian manual_print define ip_mfib_details
{
  u32 context;
  u32 table_id;
  u8  address_length;
  u8  grp_address[4];
  u8  src_address[4];
  u32 count;
  vl_api_fib_path_t path[count];
};

/** \brief Dump IP6 multicast fib table
    @param client_index - opaque cookie to identify the sender
*/
define ip6_mfib_dump
{
  u32 client_index;
  u32 context;
};

/** \brief IP6 Multicast FIB table response
    @param table_id - IP fib table id
    @address_length - mask length
    @grp_address - Group address/prefix
    @src_address - Source address
    @param count - the number of fib_path in path
    @param path  - array of of fib_path structures
*/
manual_endian manual_print define ip6_mfib_details
{
  u32 context;
  u32 table_id;
  u8  address_length;
  u8  grp_address[16];
  u8  src_address[16];
  u32 count;
  vl_api_fib_path_t path[count];
};

define ip_address_details
{
  u32 client_index;
  u32 context;
  u8 ip[16];
  u8 prefix_length;
  u32 sw_if_index;
  u8 is_ipv6;
};

define ip_address_dump
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u8 is_ipv6;
};

define ip_details
{
  u32 sw_if_index;
  u32 context;
  u8 is_ipv6;
};

define ip_dump
{
  u32 client_index;
  u32 context;
  u8 is_ipv6;
};

define mfib_signal_dump
{
  u32 client_index;
  u32 context;
};

define mfib_signal_details
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u32 table_id;
  u16 grp_address_len;
  u8 grp_address[16];
  u8 src_address[16];
  u16 ip_packet_len;
  u8 ip_packet_data[256];
};

/*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */