aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/nsh/nsh.api
blob: 45b118008be31198ada3d285947de6ae8accfc7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
option version = "1.0.0";

import "vnet/interface_types.api";

/** \brief /** \brief Set or delete an NSH header entry keyed by NSP/NSI
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param nsp_nsi - Key for nsh_header_t entry to map to. : 24bit NSP 8bit NSI 
    @param md_type - metadata type [1|2] - only MDType1 supported today
    @param ver_o_c - version, O-bit and C-bit (see nsh_packet.h)
    @param ttl - indicates the maximum SFF hops for an SFP
    @param length - header length in n x 32bits, should be 6 for MDtype1
    @param next_protocol - next protocol encapsulated behind NSH header: 1=Ethernet, 2=IP4, 3=IP6
    @param c1 - 32bit Metadata type1 field (context1)
    @param c2 - 32bit Metadata type1 field (context2)
    @param c3 - 32bit Metadata type1 field (context3)
    @param c4 - 32bit Metadata type1 field (context4)
    @param tlvs - Metadata Type 2 only, Type Length Value metadata.
*/
define nsh_add_del_entry {
    u32 client_index;
    u32 context;
    bool is_add;
    u32 nsp_nsi;
    u8 md_type;
    u8 ver_o_c;
    u8 ttl;
    u8 length;
    u8 next_protocol;
    u32 c1;
    u32 c2;
    u32 c3;
    u32 c4;
    u8 tlv_length;
    u8 tlv[248];
};

/** \brief Reply from adding NSH entry (nsh_add_del_entry)
    @param context - sender context, to match reply w/ request
    @param retval - 0 means all ok
*/
define nsh_add_del_entry_reply {
    u32 context;
    i32 retval;
    u32 entry_index;
};


define nsh_entry_dump {
    u32 client_index;
    u32 context;
    u32 entry_index;
};

define nsh_entry_details {
    u32 context;
    u32 entry_index;
    u32 nsp_nsi;
    u8 md_type;
    u8 ver_o_c;
    u8 ttl;
    u8 length;
    u8 next_protocol;
    u32 c1;
    u32 c2;
    u32 c3;
    u32 c4;
    u8 tlv_length;
    u8 tlv[248];
};

/** \brief Set or delete a mapping from one NSH header to another and its egress (decap to inner packet, encap NSH with outer header)
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param nsh_nsi - Key for nsh_header_t entry to map to. : 24bit NSP 8bit NSI
    @param mapped_nsp_nsi - Key for nsh_header_t entry to map to. : 24bit NSP 8bit NSI this may be ~0
       if next action is to decap to NSH next protocol
       Note the following heuristic:
       	    - if nsp_nsi == mapped_nsp_nsi then use-case is like SFC SFF
    	    - if nsp_nsi != mapped_nsp_nsi then use-case is like SFC SF
       Note: these are heuristics. Rules about NSI decrement are out of scope
    @param sw_if_index - index number of outer encap for NSH egress
    @param next_node - explicitly which node to send to
      Note the above parameters are instantiated by "encap-gre-intf <x>" means sw_if_index x, next_node gre-input
*/
define nsh_add_del_map {
    u32 client_index;
    u32 context;
    bool is_add;
    u32 nsp_nsi;
    u32 mapped_nsp_nsi;
    u32 nsh_action;
    vl_api_interface_index_t sw_if_index;
    vl_api_interface_index_t rx_sw_if_index;
    u32 next_node;
};

/** \brief Reply from adding NSH map (nsh_add_del_map)
    @param context - sender context, to match reply w/ request
    @param retval - 0 means all ok
*/
define nsh_add_del_map_reply {
    u32 context;
    i32 retval;
    u32 map_index;
};

define nsh_map_dump {
    u32 client_index;
    u32 context;
    u32 map_index;
};

define nsh_map_details {
    u32 context;
    u32 map_index;
    u32 nsp_nsi;
    u32 mapped_nsp_nsi;
    u32 nsh_action;
    vl_api_interface_index_t sw_if_index;
    vl_api_interface_index_t rx_sw_if_index;
    u32 next_node;
};
pan> ip4_address_t dst; /* FIB indices */ u32 encap_fib_index; /* tunnel partner lookup here */ u32 decap_fib_index; /* inner IP lookup here */ /* vnet intfc hw/sw_if_index */ u32 hw_if_index; /* encap header fields in HOST byte order */ u32 FIXME; } " encap_stack "_tunnel_t; #define foreach_" encap_stack "_input_next \\ _(DROP, \"error-drop\") \\ _(IP4_INPUT, \"ip4-input\") \\ _(IP6_INPUT, \"ip6-input\") \\ _(ETHERNET_INPUT, \"ethernet-input\") \\ _(" ENCAP_STACK "_ENCAP, \"" encap-stack "-encap\") typedef enum { #define _(s,n) " ENCAP_STACK "_INPUT_NEXT_##s, foreach_" encap_stack "_input_next #undef _ " ENCAP_STACK "_INPUT_N_NEXT, } " encap_stack "_input_next_t; typedef enum { #define " encap_stack "_error(n,s) " ENCAP_STACK "_ERROR_##n, #include <vnet/" encap-stack "/" encap_stack "_error.def> #undef " encap_stack "_error " ENCAP_STACK "_N_ERROR, } " encap_stack "_input_error_t; typedef struct { /* vector of encap tunnel instances */ " encap_stack "_tunnel_t *tunnels; /* lookup tunnel by key */ uword * " encap_stack "_tunnel_by_key; /* Free vlib hw_if_indices */ u32 * free_" encap_stack "_tunnel_hw_if_indices; /* convenience */ vlib_main_t * vlib_main; vnet_main_t * vnet_main; } " encap_stack "_main_t; " encap_stack "_main_t " encap_stack "_main; vlib_node_registration_t " encap_stack "_input_node; vlib_node_registration_t " encap_stack "_encap_node; u8 * format_" encap_stack "_encap_trace (u8 * s, va_list * args); u8 * format_" encap_stack "_header_with_length (u8 * s, va_list * args); typedef struct { u8 is_add; ip4_address_t src, dst; u32 encap_fib_index; u32 decap_fib_index; u32 decap_next_index; /* encap fields in HOST byte order */ u8 FIXME_HOST_BYTE_ORDER; } vnet_" encap_stack "_add_del_tunnel_args_t; int vnet_" encap_stack "_add_del_tunnel (vnet_" encap_stack "_add_del_tunnel_args_t *a, u32 * hw_if_indexp); u8 * format_" encap_stack "_header_with_length (u8 * s, va_list * args); #endif /* included_vnet_" encap_stack "_h */ ")