IPv6 to IPv4 translation.
More...
Go to the source code of this file.
|
static_always_inline int | ip6_parse (const ip6_header_t *ip6, u32 buff_len, u8 *l4_protocol, u16 *l4_offset, u16 *frag_hdr_offset) |
| Parse some useful information from IPv6 header. More...
|
|
static u16 | ip6_get_port (ip6_header_t *ip6, u8 sender, u16 buffer_len) |
| Get TCP/UDP port number or ICMP id from IPv6 packet. More...
|
|
static_always_inline int | icmp6_to_icmp_header (icmp46_header_t *icmp, ip6_header_t **inner_ip6) |
| Convert type and code value from ICMP6 to ICMP4. More...
|
|
static_always_inline u8 | ip6_translate_tos (const ip6_header_t *ip6) |
| Translate TOS value from IPv6 to IPv4. More...
|
|
static int | icmp6_to_icmp (vlib_buffer_t *p, ip6_to_ip4_set_fn_t fn, void *ctx, ip6_to_ip4_set_fn_t inner_fn, void *inner_ctx) |
| Translate ICMP6 packet to ICMP4. More...
|
|
static int | ip6_to_ip4_fragmented (vlib_buffer_t *p, ip6_to_ip4_set_fn_t fn, void *ctx) |
| Translate IPv6 fragmented packet to IPv4. More...
|
|
static int | ip6_to_ip4_tcp_udp (vlib_buffer_t *p, ip6_to_ip4_set_fn_t fn, void *ctx, u8 udp_checksum) |
| Translate IPv6 UDP/TCP packet to IPv4. More...
|
|
static int | ip6_to_ip4 (vlib_buffer_t *p, ip6_to_ip4_set_fn_t fn, void *ctx) |
| Translate IPv6 packet to IPv4 (IP header only). More...
|
|
IPv6 to IPv4 translation.
Definition in file ip6_to_ip4.h.
#define frag_id_6to4 |
( |
|
id | ) |
((id) ^ ((id) >> 16)) |
IPv6 to IPv4 set call back function type.
Definition at line 27 of file ip6_to_ip4.h.
Translate ICMP6 packet to ICMP4.
- Parameters
-
p | Buffer to translate. |
fn | The function to translate outer header. |
ctx | A context passed in the outer header translate function. |
inner_fn | The function to translate inner header. |
inner_ctx | A context passed in the inner header translate function. |
- Returns
- 0 on success, non-zero value otherwise.
Definition at line 249 of file ip6_to_ip4.h.
Convert type and code value from ICMP6 to ICMP4.
- Parameters
-
icmp | ICMP header. |
inner_ip6 | Inner IPv6 header if present, 0 otherwise. |
- Returns
- 0 on success, non-zero value otherwise.
Definition at line 136 of file ip6_to_ip4.h.
Get TCP/UDP port number or ICMP id from IPv6 packet.
- Parameters
-
ip6 | IPv6 header. |
sender | 1 get sender port, 0 get receiver port. |
buffer_len | Buffer length. |
- Returns
- Port number on success, 0 otherwise.
Definition at line 90 of file ip6_to_ip4.h.
Parse some useful information from IPv6 header.
- Parameters
-
ip6 | IPv6 header. |
buff_len | Buffer length. |
l4_protocol | L4 protocol number. |
l4_offset | L4 header offset. |
frag_hdr_offset | Fragment header offset if present, 0 otherwise. |
- Returns
- 0 on success, non-zero value otherwise.
Definition at line 59 of file ip6_to_ip4.h.
Translate IPv6 packet to IPv4 (IP header only).
- Parameters
-
p | Buffer to translate. |
fn | The function to translate header. |
ctx | A context passed in the header translate function. |
- Returns
- 0 on success, non-zero value otherwise.
Definition at line 575 of file ip6_to_ip4.h.
Translate IPv6 fragmented packet to IPv4.
- Parameters
-
p | Buffer to translate. |
fn | The function to translate header. |
ctx | A context passed in the header translate function. |
- Returns
- 0 on success, non-zero value otherwise.
Definition at line 422 of file ip6_to_ip4.h.
Translate IPv6 UDP/TCP packet to IPv4.
- Parameters
-
p | Buffer to translate. |
fn | The function to translate header. |
ctx | A context passed in the header translate function. |
- Returns
- 0 on success, non-zero value otherwise.
Definition at line 478 of file ip6_to_ip4.h.
Translate TOS value from IPv6 to IPv4.
- Parameters
-
- Returns
- IPv4 TOS value.
Definition at line 231 of file ip6_to_ip4.h.
u8 icmp6_to_icmp_updater_pointer_table[] |
|
static |
Initial value:=
{ 0, 1, ~0, ~0,
2, 2, 9, 8,
12, 12, 12, 12,
12, 12, 12, 12,
12, 12, 12, 12,
12, 12, 12, 12,
24, 24, 24, 24,
24, 24, 24, 24,
24, 24, 24, 24,
24, 24, 24, 24
}
Definition at line 31 of file ip6_to_ip4.h.