summaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6/sr_localsid.c
AgeCommit message (Expand)AuthorFilesLines
2020-07-28sr: fix prefix_len type parsingBenoƮt Ganne1-1/+1
2020-05-15misc: removed executable bits from source filesRay Kinsella1-0/+0
2020-04-08sr: Fix the coverity issueTetsuya Murakami1-15/+5
2020-04-07sr: Support uSID function.Tetsuya Murakami1-9/+792
2020-03-25sr: Change the CLI keyword from address to prefix.Tetsuya Murakami1-1/+1
2020-03-21srv6-mobile: Fix the localsid length issue on vnet/srv6Tetsuya Murakami1-5/+6
2020-03-12sr: SRv6 uN behaviorPablo Camarillo1-26/+35
2020-02-11sr: update NH value for Ethernet payloadspcamaril1-1/+1
2020-01-27sr: fix possible null-pointer dereferenceIgnas Bacius1-1/+1
2020-01-16sr: some fixes for SRv6 CLI/APIAhmed Abdelsalam1-3/+8
2019-11-19srv6-mobileTetsuya Murakami1-20/+52
2019-09-25ip: respect buffer boundary when searching for ipv6 headersKlement Sekera1-12/+20
2019-07-28sr: fix srv6 end.t behaviorAhmed Abdelsalam1-1/+2
2018-10-23c11 safe string handling supportDave Barach1-3/+3
2018-07-12srv6: fix pointers in quad loopsFrancois Clad1-6/+6
2018-07-11avoid using thread local storage for thread indexDamjan Marion1-2/+2
2018-06-19Fixed bugs in SRv6 APIPablo Camarillo1-2/+1
2018-03-14srv6: minor CLI modificationsFrancois Clad1-2/+2
2018-02-27SRv6: API uses table-IDs not FIB indiciesNeale Ranns1-3/+3
2017-08-22SRv6 testsKris Michielsen1-29/+196
2017-06-07VPP-872 and End.T function for SRv6Pablo Camarillo1-98/+93
2017-05-05First commit SR MPLSPablo Camarillo1-0/+1492
ghlight .mo { color: #ae81ff } /* Literal.Number.Oct */ .highlight .sa { color: #e6db74 } /* Literal.String.Affix */ .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */ .highlight .sc { color: #e6db74 } /* Literal.String.Char */ .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { 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 */ }
/*
 * 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.
 */

option version = "3.1.0";

import "vnet/ip/ip_types.api";

/** \brief Add MAP domains
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param ip6_prefix - Rule IPv6 prefix
    @param ip4_prefix - Rule IPv4 prefix
    @param ip6_src - MAP domain IPv6 BR address / Tunnel source
    @param ea_bits_len - Embedded Address bits length
    @param psid_offset - Port Set Identifider (PSID) offset
    @param psid_length - PSID length
    @param mtu - MTU
    @param tag - A user field stored with the MAP
*/
define map_add_domain
{
  u32 client_index;
  u32 context;
  vl_api_ip6_prefix_t ip6_prefix;
  vl_api_ip4_prefix_t ip4_prefix;
  vl_api_ip6_prefix_t ip6_src;
  u8 ea_bits_len;
  u8 psid_offset;
  u8 psid_length;
  u16 mtu;
  string tag;
};

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

/** \brief Delete MAP domain
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param index - MAP Domain index
*/
autoreply define map_del_domain
{
  u32 client_index;
  u32 context;
  u32 index;
};


/** \brief Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber)
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param index - MAP Domain index
    @param is_add - If 1 add rule, if 0 delete rule
    @param ip6_dst - MAP CE IPv6 address
    @param psid - Rule PSID
*/
autoreply define map_add_del_rule
{
  u32 client_index;
  u32 context;
  u32 index;
  bool is_add;
  vl_api_ip6_address_t ip6_dst;
  u16 psid;
};


/** \brief Get list of map domains
    @param client_index - opaque cookie to identify the sender
*/
define map_domain_dump
{
  u32 client_index;
  u32 context;
};

/** \brief Details about a single MAP domain
    @param context - returned sender context, to match reply w/ request
    @param domain_index - MAP domain index
    @param ip6_prefix - Rule IPv6 prefix
    @param ip4_prefix - Rule IPv4 prefix
    @param ip6_src - MAP domain IPv6 BR address / Tunnel source
    @param ea_bits_len - Embedded Address bits length
    @param psid_offset - Port Set Identifider (PSID) offset
    @param psid_length - PSID length
    @param flags -
    @param mtu - MTU
    @param tag - The user field stored with the MAP at creation time
*/
define map_domain_details
{
  u32 context;
  u32 domain_index;
  vl_api_ip6_prefix_t ip6_prefix;
  vl_api_ip4_prefix_t ip4_prefix;
  vl_api_ip6_prefix_t ip6_src;
  u8 ea_bits_len;
  u8 psid_offset;
  u8 psid_length;
  u8 flags;
  u16 mtu;
  string tag;
};

define map_rule_dump
{
  u32 client_index;
  u32 context;
  u32 domain_index;
};

define map_rule_details
{
  u32 context;
  vl_api_ip6_address_t ip6_dst;
  u16 psid;
};

/** \brief Enable or disable a MAP interface
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - 
    @param is_enable - 0=disable, 1=enable interface
    @param is_translation -  0=encapsulation, 1=translation
*/
autoreply define map_if_enable_disable
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  bool is_enable;
  bool is_translation; /* 0 - encapsulation, 1 - translation */
};

/** \brief Request for a single block of summary stats
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define map_summary_stats
{
  u32 client_index;
  u32 context;
};

/** \brief Reply for map_summary_stats request
    @param context - sender context, to match reply w/ request
    @param retval - return code for request
    @param total_bindings -
    @param total_pkts -
    @param total_ip4_fragments -
    @param total_security_check -
*/
define map_summary_stats_reply
{
  u32 context;
  i32 retval;
  u64 total_bindings;
  u64 total_pkts[2];
  u64 total_bytes[2];
  u64 total_ip4_fragments;
  u64 total_security_check[2];
};


/** \brief Set MAP fragmentation parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param inner - 1=frag inner packet, 0=frag tunnel packets
    @param ignore_df - 1=IP4 fragment despite DF bit, 0=honor DF
*/
autoreply define map_param_set_fragmentation
{
  u32 client_index;
  u32 context;
  bool inner;
  bool ignore_df;
};


/** \brief Set MAP ICMP parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param icmp4_err_relay_src - IPv4 ICMP err relay src address
*/
autoreply define map_param_set_icmp
{
  u32 client_index;
  u32 context;
  vl_api_ip4_address_t ip4_err_relay_src;
};


/** \brief Set MAP ICMP6 parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param enable_unreachable - 1 = send ICMP unreachable err msgs
*/
autoreply define map_param_set_icmp6
{
  u32 client_index;
  u32 context;
  bool enable_unreachable;
};


/** \brief Add/delete MAP pre-resolve IP addresses parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - 1 = Add non-zero IP addresses, 0 = delete
    @param ip4_nh_address - direct IP4 next-hop address
    @param ip6_nh_address - direct IP6 next-hop address
*/
autoreply define map_param_add_del_pre_resolve
{
  u32 client_index;
  u32 context;
  bool is_add;
  vl_api_ip4_address_t ip4_nh_address;
  vl_api_ip6_address_t ip6_nh_address;
};


/** \brief Set MAP reassembly parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_ip6 - 1 = params apply to IPv6, 0 = params apply to IPv4
    @param lifetime_ms - reassembly valid lifetime, or ~0
    @param pool_size - max number of reassemblies, or ~0
    @param buffers -  max number of reassembly buffers, or ~0 
    @param ht_ratio - hash-table size factor, or ~0
*/
autoreply define map_param_set_reassembly
{
  u32 client_index;
  u32 context;
  bool is_ip6;
  u16 lifetime_ms;
  u16 pool_size;
  u32 buffers;
  f64 ht_ratio;
};


/** \brief Set MAP security-check parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param enable - 1=enable security check on first inbound packet
    @param fragments - 1=enable check on (subsequent) fragments too
*/
autoreply define map_param_set_security_check
{
  u32 client_index;
  u32 context;
  bool enable;
  bool fragments;
};


/** \brief Set MAP traffic class parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param copy - 1 = copy packet class/TOS field, 0 = use class instead
    @param class - class field value when copy == 0
*/
autoreply define map_param_set_traffic_class
{
  u32 client_index;
  u32 context;
  bool copy;
  u8 class;
};


/** \brief Set MAP TCP parammeters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @parma tcp_mss - TCP MSS clamping value
*/
autoreply define map_param_set_tcp
{
  u32 client_index;
  u32 context;
  u16 tcp_mss;
};


/** \brief Request for a single block of MAP parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define map_param_get
{
  u32 client_index;
  u32 context;
};


/** \brief Reply for map_param_get request
    @param context - sender context, to match reply w/ request
    @param retval - return code for request
    @param inner - 1=frag inner packet, 0=frag tunnel packets, ~0=untouched
    @param ignore_df - 1=IP4 fragm despite DF bit, 0=honor DF, ~0=untouched
    @param icmp_ip4_err_relay_src - IPv4 ICMP err relay src address
    @param icmp6_enable_unreachable - 1 = send ICMP unreachable err msgs
    @param ip4_nh_address - direct IP4 next-hop address
    @param ip6_nh_address - direct IP6 next-hop address
    @param ip4_lifetime_ms - reassembly valid lifetime, or ~0
    @param ip4_pool_size - max number of reassemblies, or ~0
    @param ip4_buffers -  max number of reassembly buffers, or ~0
    @param ip4_ht_ratio - reassembly valid lifetime, or ~0
    @param ip6_lifetime_ms - max number of reassemblies, or ~0
    @param ip6_pool_size - max number of reassemblies, or ~0
    @param ip6_buffers -  max number of reassembly buffers, or ~0 
    @param ip6_ht_ratio - hash-table size factor, or ~0
    @param sec_check_enable - 1=enable security check on first inbound packet
    @param sec_check_fragments - 1=enable check on (subsequent) fragments too
    @param tc_copy - 1 = copy packet class/TOS field, 0 = use class instead
    @param tc_class - class field value when copy == 0
*/
define map_param_get_reply
{
  u32 context;
  i32 retval;
  u8 frag_inner;
  u8 frag_ignore_df;
  vl_api_ip4_address_t icmp_ip4_err_relay_src;
  bool icmp6_enable_unreachable;
  vl_api_ip4_address_t ip4_nh_address;
  vl_api_ip6_address_t ip6_nh_address;
  u16 ip4_lifetime_ms;
  u16 ip4_pool_size;
  u32 ip4_buffers;
  f64 ip4_ht_ratio;
  u16 ip6_lifetime_ms;
  u16 ip6_pool_size;
  u32 ip6_buffers;
  f64 ip6_ht_ratio;
  bool sec_check_enable;
  bool sec_check_fragments;
  bool tc_copy;
  u8 tc_class;
};