blob: 95fc48a5962dfa19557b68f92c87037da83c43ea [file] [log] [blame]
Ole Troan298c6952018-03-08 12:30:43 +01001/*
2 * Copyright (c) 2018 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
Ole Troand57f6362018-05-24 13:21:43 +020016/**
17 * The IPIP module implements IP{v4,v6} over IP{v4,v6} tunnelling as
18 * described in RFC2473 and to some extent the largely historical
19 * RFC1853. The module also supports an IPv4 over IPv6 automatic
20 * tunnelling mechanism called 6RD (RFC5969).
21 *
22 * The IPIP API module supports a CRD model for adding, deleting and
23 * listing tunnels. A tunnel is represented as an interface in
24 * VPP. The "handle" representing a tunnel is the sw_if_index. As any
25 * interface, the user must configure an IPv4 and/or IPv6 address on
26 * the interface. This is the inner or payload protocol.
27 *
28 * Tunnel MTU: The tunnel MTU (the payload MTU) is configurable per
29 * protocol. If a tunnel MTU is larger than the path MTU, the outer
30 * packet will be fragmented. Fragmentation support is configurable,
31 * as it can have severe performance issues, and might be used as an
32 * attack vector (the remote side must reassemble.)
33 *
34 * Traffic class / TOS field can either be configured to a fixed
35 * value, or can be copied from the inner to the outer header.
36 * (For now we have stolen ~0 to indicate copy).
37 *
38 * Note:
39 *
40 * - The Tunnel encapsulation limit described in RFC2473 is not
41 * implemented.
42 *
43 * - ICMP proxying, as in a tunnel head-end receiving ICMP erors on
44 * the outer packet is currently not relayed to the original source
45 * of the packet.
46 *
47 * - PMTUD / MTU probing and tunnel keepalives are not yet implemented.
48 *
49 */
Ole Troan298c6952018-03-08 12:30:43 +010050
Ole Troand57f6362018-05-24 13:21:43 +020051option version = "1.1.0";
52
53/**
54 * Create an IP{v4,v6} over IP{v4,v6} tunnel.
55 */
Ole Troan298c6952018-03-08 12:30:43 +010056define ipip_add_tunnel
57{
58 u32 client_index;
59 u32 context;
60 u8 is_ipv6;
61 u32 instance; /* If non-~0, specifies a custom dev instance */
62 u8 src_address[16];
63 u8 dst_address[16];
64 u32 fib_index;
Ole Troand57f6362018-05-24 13:21:43 +020065 u8 tc_tos; /* If ~0, the TOS/TC value is copied from
66 inner packet, otherwise set to value */
Ole Troan298c6952018-03-08 12:30:43 +010067};
68
69define ipip_add_tunnel_reply
70{
71 u32 context;
72 i32 retval;
73 u32 sw_if_index;
74};
75
Ole Troand57f6362018-05-24 13:21:43 +020076/**
77 * Delete an IP{v4,v6} over IP{v4,v6} tunnel.
78 */
Ole Troan298c6952018-03-08 12:30:43 +010079autoreply define ipip_del_tunnel
80{
81 u32 client_index;
82 u32 context;
83 u32 sw_if_index;
84};
85
Ole Troand57f6362018-05-24 13:21:43 +020086/**
87 * Create an IPv4 over IPv6 automatic tunnel (6RD)
88 */
Ole Troan298c6952018-03-08 12:30:43 +010089define ipip_6rd_add_tunnel
90{
91 u32 client_index;
92 u32 context;
93 u32 fib_index;
94 u8 ip6_prefix[16];
95 u8 ip4_prefix[4];
96 u8 ip4_src[4];
97 u8 ip6_prefix_len;
98 u8 ip4_prefix_len;
99 u8 security_check;
Ole Troand57f6362018-05-24 13:21:43 +0200100 u8 tc_tos; /* If ~0, the TOS/TC value is copied from
101 inner packet, otherwise set to value */
Ole Troan298c6952018-03-08 12:30:43 +0100102};
103
104define ipip_6rd_add_tunnel_reply
105{
106 u32 context;
107 i32 retval;
108 u32 sw_if_index;
109};
110
Ole Troand57f6362018-05-24 13:21:43 +0200111/**
112 * Delete an IPv4 over IPv6 automatic tunnel (6RD)
113 */
Ole Troan298c6952018-03-08 12:30:43 +0100114autoreply define ipip_6rd_del_tunnel
115{
116 u32 client_index;
117 u32 context;
118 u32 sw_if_index;
119};
120
Ole Troand57f6362018-05-24 13:21:43 +0200121/**
122 * List all IPIP tunnels
123 */
Ole Troan298c6952018-03-08 12:30:43 +0100124define ipip_tunnel_dump
125{
126 u32 client_index;
127 u32 context;
128 u32 sw_if_index;
129};
130
131define ipip_tunnel_details
132{
133 u32 context;
134 u32 sw_if_index;
135 u32 instance;
136 u8 is_ipv6;
137 u8 src_address[16];
138 u8 dst_address[16];
139 u32 fib_index;
Ole Troand57f6362018-05-24 13:21:43 +0200140 u8 tc_tos;
Ole Troan298c6952018-03-08 12:30:43 +0100141};
142
143/*
144 * Local Variables:
145 * eval: (c-set-style "gnu")
146 * End:
147 */