Coverage Report

Created: 2025-07-18 06:07

/src/openvswitch/lib/netdev-native-tnl.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (c) 2010, 2011, 2013, 2015 Nicira, Inc.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at:
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
17
#ifndef NETDEV_VPORT_NATIVE_TNL_H
18
#define NETDEV_VPORT_NATIVE_TNL_H 1
19
20
#include <stdbool.h>
21
#include <stddef.h>
22
#include "compiler.h"
23
#include "dp-packet.h"
24
#include "packets.h"
25
#include "unixctl.h"
26
27
struct netdev;
28
struct ovs_action_push_tnl;
29
struct netdev_tnl_build_header_params;
30
31
int
32
netdev_gre_build_header(const struct netdev *netdev,
33
                        struct ovs_action_push_tnl *data,
34
                        const struct netdev_tnl_build_header_params *params);
35
36
void
37
netdev_gre_push_header(const struct netdev *netdev,
38
                       struct dp_packet *packet,
39
                       const struct ovs_action_push_tnl *data);
40
struct dp_packet *
41
netdev_gre_pop_header(struct dp_packet *packet);
42
43
int
44
netdev_erspan_build_header(const struct netdev *netdev,
45
                           struct ovs_action_push_tnl *data,
46
                           const struct netdev_tnl_build_header_params *p);
47
48
void
49
netdev_erspan_push_header(const struct netdev *netdev,
50
                          struct dp_packet *packet,
51
                          const struct ovs_action_push_tnl *data);
52
struct dp_packet *
53
netdev_erspan_pop_header(struct dp_packet *packet);
54
55
struct dp_packet *
56
netdev_gtpu_pop_header(struct dp_packet *packet);
57
58
void
59
netdev_gtpu_push_header(const struct netdev *netdev,
60
                        struct dp_packet *packet,
61
                        const struct ovs_action_push_tnl *data);
62
63
int
64
netdev_gtpu_build_header(const struct netdev *netdev,
65
                         struct ovs_action_push_tnl *data,
66
                         const struct netdev_tnl_build_header_params *p);
67
68
struct dp_packet *netdev_srv6_pop_header(struct dp_packet *);
69
70
void netdev_srv6_push_header(const struct netdev *,
71
                             struct dp_packet *,
72
                             const struct ovs_action_push_tnl *);
73
74
int netdev_srv6_build_header(const struct netdev *,
75
                             struct ovs_action_push_tnl *,
76
                             const struct netdev_tnl_build_header_params *);
77
78
void
79
netdev_tnl_push_udp_header(const struct netdev *netdev,
80
                           struct dp_packet *packet,
81
                           const struct ovs_action_push_tnl *data);
82
int
83
netdev_geneve_build_header(const struct netdev *netdev,
84
                           struct ovs_action_push_tnl *data,
85
                           const struct netdev_tnl_build_header_params *params);
86
87
struct dp_packet *
88
netdev_geneve_pop_header(struct dp_packet *packet);
89
90
int
91
netdev_vxlan_build_header(const struct netdev *netdev,
92
                          struct ovs_action_push_tnl *data,
93
                          const struct netdev_tnl_build_header_params *params);
94
95
struct dp_packet *
96
netdev_vxlan_pop_header(struct dp_packet *packet);
97
98
static inline bool
99
netdev_tnl_is_header_ipv6(const void *header)
100
0
{
101
0
    const struct eth_header *eth;
102
0
    eth = header;
103
0
    return eth->eth_type == htons(ETH_TYPE_IPV6);
104
0
}
Unexecuted instantiation: netdev-vport.c:netdev_tnl_is_header_ipv6
Unexecuted instantiation: netdev-native-tnl.c:netdev_tnl_is_header_ipv6
105
106
static inline struct ip_header *
107
netdev_tnl_ip_hdr(void *eth)
108
0
{
109
0
    return (void *)((char *)eth + sizeof (struct eth_header));
110
0
}
Unexecuted instantiation: netdev-vport.c:netdev_tnl_ip_hdr
Unexecuted instantiation: netdev-native-tnl.c:netdev_tnl_ip_hdr
111
112
static inline struct ovs_16aligned_ip6_hdr *
113
netdev_tnl_ipv6_hdr(void *eth)
114
0
{
115
0
    return (void *)((char *)eth + sizeof (struct eth_header));
116
0
}
Unexecuted instantiation: netdev-vport.c:netdev_tnl_ipv6_hdr
Unexecuted instantiation: netdev-native-tnl.c:netdev_tnl_ipv6_hdr
117
118
void *
119
netdev_tnl_ip_build_header(struct ovs_action_push_tnl *data,
120
                           const struct netdev_tnl_build_header_params *params,
121
                           uint8_t next_proto, ovs_be32 ipv6_label);
122
123
extern uint16_t tnl_udp_port_min;
124
extern uint16_t tnl_udp_port_max;
125
126
ovs_be16 netdev_tnl_get_src_port(struct dp_packet *);
127
128
void *
129
netdev_tnl_push_ip_header(struct dp_packet *packet, const void *header,
130
                          int size, int *ip_tot_size, ovs_be32 ipv6_label);
131
void
132
netdev_tnl_egress_port_range(struct unixctl_conn *conn, int argc,
133
                             const char *argv[], void *aux OVS_UNUSED);
134
#endif