# Layer 3 protocol: IP v4/v6
########################################
libvnet_la_SOURCES += \
+ vnet/ip/feature_registration.c \
vnet/ip/format.c \
vnet/ip/icmp4.c \
vnet/ip/icmp6.c \
- vnet/ip/ip_feature_registration.c \
vnet/ip/ip46_cli.c \
- vnet/ip/ping.c \
vnet/ip/ip4_format.c \
vnet/ip/ip4_forward.c \
vnet/ip/ip4_input.c \
vnet/ip/ip4_mtrie.c \
vnet/ip/ip4_pg.c \
- vnet/ip/ip4_source_check.c \
vnet/ip/ip4_source_and_port_range_check.c \
+ vnet/ip/ip4_source_check.c \
vnet/ip/ip6_format.c \
vnet/ip/ip6_forward.c \
vnet/ip/ip6_hop_by_hop.c \
vnet/ip/ip6_neighbor.c \
vnet/ip/ip6_pg.c \
vnet/ip/ip_checksum.c \
+ vnet/ip/ip_frag.c \
vnet/ip/ip.h \
vnet/ip/ip_init.c \
+ vnet/ip/ip_input_acl.c \
vnet/ip/lookup.c \
+ vnet/ip/ping.c \
+ vnet/ip/punt.c \
vnet/ip/udp_format.c \
vnet/ip/udp_init.c \
vnet/ip/udp_local.c \
- vnet/ip/punt.c \
- vnet/ip/udp_pg.c \
- vnet/ip/ip_input_acl.c \
- vnet/ip/ip_frag.c
+ vnet/ip/udp_pg.c
nobase_include_HEADERS += \
+ vnet/ip/feature_registration.h \
vnet/ip/format.h \
vnet/ip/icmp46_packet.h \
vnet/ip/icmp4.h \
vnet/ip/icmp6.h \
vnet/ip/igmp_packet.h \
- vnet/ip/ip.h \
- vnet/ip/ip_feature_registration.h \
- vnet/ip/ip_source_and_port_range_check.h \
+ vnet/ip/ip4_error.h \
vnet/ip/ip4.h \
vnet/ip/ip4_mtrie.h \
- vnet/ip/ip4_error.h \
vnet/ip/ip4_packet.h \
- vnet/ip/ip6.h \
vnet/ip/ip6_error.h \
+ vnet/ip/ip6.h \
vnet/ip/ip6_hop_by_hop.h \
vnet/ip/ip6_hop_by_hop_packet.h \
vnet/ip/ip6_packet.h \
- vnet/ip/lookup.h \
+ vnet/ip/ip.h \
vnet/ip/ip_packet.h \
+ vnet/ip/ip_source_and_port_range_check.h \
+ vnet/ip/lookup.h \
vnet/ip/ports.def \
vnet/ip/protocols.def \
+ vnet/ip/punt_error.def \
+ vnet/ip/punt.h \
vnet/ip/tcp_packet.h \
- vnet/ip/udp.h \
vnet/ip/udp_error.def \
- vnet/ip/udp_packet.h \
- vnet/ip/punt_error.def \
- vnet/ip/punt.h
+ vnet/ip/udp.h \
+ vnet/ip/udp_packet.h
########################################
# Layer 3 protocol: IPSec
#include <vnet/vnet.h>
#include <vnet/ethernet/packet.h>
#include <vnet/pg/pg.h>
-#include <vnet/ip/ip_feature_registration.h>
+#include <vnet/ip/feature_registration.h>
always_inline u64
ethernet_mac_address_u64 (u8 * a)
ip_config_main_t feature_config_mains[VNET_N_IP_FEAT];
/** Feature path configuration lists */
- vnet_ip_feature_registration_t *next_feature[VNET_N_IP_FEAT];
+ vnet_feature_registration_t *next_feature[VNET_N_IP_FEAT];
/** Save results for show command */
char **feature_nodes[VNET_N_IP_FEAT];
ethernet_main_t ethernet_main;
#define VNET_ETHERNET_TX_FEATURE_INIT(x,...) \
- __VA_ARGS__ vnet_ip_feature_registration_t tx_##x; \
+ __VA_ARGS__ vnet_feature_registration_t tx_##x; \
static void __vnet_add_feature_registration_tx_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_tx_##x (void) \
tx_##x.next = im->next_feature[VNET_IP_TX_FEAT]; \
im->next_feature[VNET_IP_TX_FEAT] = &tx_##x; \
} \
-__VA_ARGS__ vnet_ip_feature_registration_t tx_##x
+__VA_ARGS__ vnet_feature_registration_t tx_##x
always_inline ethernet_type_info_t *
feature subgraph arc, which needs to run before @c ip4-lookup. In
either base code or a plugin,
<CODE><PRE>
- \#include <vnet/ip/ip_feature_registration.h>
+ \#include <vnet/ip/feature_registration.h>
</PRE></CODE>
and add the new feature as shown:
vnet_config_main_t * vcm,
char **feature_start_nodes,
int num_feature_start_nodes,
- vnet_ip_feature_registration_t * first_reg,
+ vnet_feature_registration_t * first_reg,
char ***in_feature_nodes)
{
uword *index_by_name;
int a_index, b_index;
int n_features;
u32 *result = 0;
- vnet_ip_feature_registration_t *this_reg = 0;
+ vnet_feature_registration_t *this_reg = 0;
char **feature_nodes = 0;
hash_pair_t *hp;
u8 **keys_to_delete = 0;
{
p = hash_get (reg_by_index, result[i]);
ASSERT (p != 0);
- this_reg = (vnet_ip_feature_registration_t *) p[0];
+ this_reg = (vnet_feature_registration_t *) p[0];
*this_reg->feature_index = n_features - (i + 1);
vec_add1 (feature_nodes, this_reg->node_name);
}
* limitations under the License.
*/
-#ifndef included_ip_feature_registration_h
-#define included_ip_feature_registration_h
+#ifndef included_feature_registration_h
+#define included_feature_registration_h
/** feature registration object */
-typedef struct _vnet_ip_feature_registration
+typedef struct _vnet_feature_registration
{
/** next registration in list of all registrations*/
- struct _vnet_ip_feature_registration *next;
+ struct _vnet_feature_registration *next;
/** Graph node name */
char *node_name;
/** Pointer to this feature index, filled in by vnet_feature_arc_init */
char **runs_before;
/** Constraints of the form "this feature runs after Y" */
char **runs_after;
-} vnet_ip_feature_registration_t;
+} vnet_feature_registration_t;
typedef struct ip_config_main_t_
{
vnet_config_main_t * vcm,
char **feature_start_nodes,
int num_feature_start_nodes,
- vnet_ip_feature_registration_t *
+ vnet_feature_registration_t *
first_reg, char ***feature_nodes);
void ip_interface_features_show (vlib_main_t * vm,
const char *pname,
ip_config_main_t * cm, u32 sw_if_index);
-#endif /* included_ip_feature_registration_h */
+#endif /* included_feature_registration_h */
/*
* fd.io coding-style-patch-verification: ON
#include <vnet/ip/ip4_mtrie.h>
#include <vnet/ip/ip4_packet.h>
#include <vnet/ip/lookup.h>
-#include <vnet/ip/ip_feature_registration.h>
+#include <vnet/ip/feature_registration.h>
typedef struct ip4_fib_t {
/* Hash table for each prefix length mapping. */
vlib_packet_template_t ip4_arp_request_packet_template;
/** Feature path configuration lists */
- vnet_ip_feature_registration_t * next_feature[VNET_N_IP_FEAT];
+ vnet_feature_registration_t * next_feature[VNET_N_IP_FEAT];
/** Built-in unicast feature path index, see @ref vnet_feature_arc_init() */
u32 ip4_unicast_rx_feature_check_access;
extern ip4_main_t ip4_main;
#define VNET_IP4_UNICAST_FEATURE_INIT(x,...) \
- __VA_ARGS__ vnet_ip_feature_registration_t uc_##x; \
+ __VA_ARGS__ vnet_feature_registration_t uc_##x; \
static void __vnet_add_feature_registration_uc_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_uc_##x (void) \
uc_##x.next = im->next_feature[VNET_IP_RX_UNICAST_FEAT]; \
im->next_feature[VNET_IP_RX_UNICAST_FEAT] = &uc_##x; \
} \
-__VA_ARGS__ vnet_ip_feature_registration_t uc_##x
+__VA_ARGS__ vnet_feature_registration_t uc_##x
#define VNET_IP4_MULTICAST_FEATURE_INIT(x,...) \
- __VA_ARGS__ vnet_ip_feature_registration_t mc_##x; \
+ __VA_ARGS__ vnet_feature_registration_t mc_##x; \
static void __vnet_add_feature_registration_mc_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_mc_##x (void) \
mc_##x.next = im->next_feature[VNET_IP_RX_MULTICAST_FEAT]; \
im->next_feature[VNET_IP_RX_MULTICAST_FEAT] = &mc_##x; \
} \
-__VA_ARGS__ vnet_ip_feature_registration_t mc_##x
+__VA_ARGS__ vnet_feature_registration_t mc_##x
#define VNET_IP4_TX_FEATURE_INIT(x,...) \
- __VA_ARGS__ vnet_ip_feature_registration_t tx_##x; \
+ __VA_ARGS__ vnet_feature_registration_t tx_##x; \
static void __vnet_add_feature_registration_tx_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_tx_##x (void) \
tx_##x.next = im->next_feature[VNET_IP_TX_FEAT]; \
im->next_feature[VNET_IP_TX_FEAT] = &tx_##x; \
} \
-__VA_ARGS__ vnet_ip_feature_registration_t tx_##x
+__VA_ARGS__ vnet_feature_registration_t tx_##x
/** Global ip4 input node. Errors get attached to ip4 input node. */
#include <vnet/ip/ip6_packet.h>
#include <vnet/ip/ip6_hop_by_hop_packet.h>
#include <vnet/ip/lookup.h>
-#include <vnet/ip/ip_feature_registration.h>
+#include <vnet/ip/feature_registration.h>
#include <stdbool.h>
#include <vppinfra/bihash_24_8.h>
#include <vppinfra/bihash_template.h>
uword lookup_table_size;
/* feature path configuration lists */
- vnet_ip_feature_registration_t * next_feature[VNET_N_IP_FEAT];
+ vnet_feature_registration_t * next_feature[VNET_N_IP_FEAT];
/* Built-in unicast feature path indices, see vnet_feature_arc_init(...) */
u32 ip6_unicast_rx_feature_check_access;
extern ip6_main_t ip6_main;
#define VNET_IP6_UNICAST_FEATURE_INIT(x,...) \
- __VA_ARGS__ vnet_ip_feature_registration_t uc_##x; \
+ __VA_ARGS__ vnet_feature_registration_t uc_##x; \
static void __vnet_add_feature_registration_uc_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_uc_##x (void) \
uc_##x.next = im->next_feature[VNET_IP_RX_UNICAST_FEAT]; \
im->next_feature[VNET_IP_RX_UNICAST_FEAT] = &uc_##x; \
} \
-__VA_ARGS__ vnet_ip_feature_registration_t uc_##x
+__VA_ARGS__ vnet_feature_registration_t uc_##x
#define VNET_IP6_MULTICAST_FEATURE_INIT(x,...) \
- __VA_ARGS__ vnet_ip_feature_registration_t mc_##x; \
+ __VA_ARGS__ vnet_feature_registration_t mc_##x; \
static void __vnet_add_feature_registration_mc_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_mc_##x (void) \
mc_##x.next = im->next_feature[VNET_IP_RX_MULTICAST_FEAT]; \
im->next_feature[VNET_IP_RX_MULTICAST_FEAT] = &mc_##x; \
} \
-__VA_ARGS__ vnet_ip_feature_registration_t mc_##x
+__VA_ARGS__ vnet_feature_registration_t mc_##x
#define VNET_IP6_TX_FEATURE_INIT(x,...) \
- __VA_ARGS__ vnet_ip_feature_registration_t tx_##x; \
+ __VA_ARGS__ vnet_feature_registration_t tx_##x; \
static void __vnet_add_feature_registration_tx_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_tx_##x (void) \
tx_##x.next = im->next_feature[VNET_IP_TX_FEAT]; \
im->next_feature[VNET_IP_TX_FEAT] = &tx_##x; \
} \
-__VA_ARGS__ vnet_ip_feature_registration_t tx_##x
+__VA_ARGS__ vnet_feature_registration_t tx_##x
/* Global ip6 input node. Errors get attached to ip6 input node. */
#include <vnet/ip/ip6_packet.h>
#include <vnet/fib/fib_node.h>
#include <vnet/dpo/dpo.h>
-#include <vnet/ip/ip_feature_registration.h>
+#include <vnet/ip/feature_registration.h>
/** @brief Common (IP4/IP6) next index stored in adjacency. */
typedef enum {
u32 ip6_classify_mpls_policy_encap_next_index;
/* feature path configuration lists */
- vnet_ip_feature_registration_t * next_feature[VNET_N_IP_FEAT];
+ vnet_feature_registration_t * next_feature[VNET_N_IP_FEAT];
/* Save feature results for show command */
char **feature_nodes[VNET_N_IP_FEAT];
extern mpls_main_t mpls_main;
#define VNET_MPLS_FEATURE_INIT(x,...) \
- __VA_ARGS__ vnet_ip_feature_registration_t uc_##x; \
+ __VA_ARGS__ vnet_feature_registration_t uc_##x; \
static void __vnet_add_feature_registration_uc_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_uc_##x (void) \
uc_##x.next = mm->next_feature[VNET_IP_RX_UNICAST_FEAT]; \
mm->next_feature[VNET_IP_RX_UNICAST_FEAT] = &uc_##x; \
} \
-__VA_ARGS__ vnet_ip_feature_registration_t uc_##x
+__VA_ARGS__ vnet_feature_registration_t uc_##x
#define VNET_MPLS_TX_FEATURE_INIT(x,...) \
- __VA_ARGS__ vnet_ip_feature_registration_t tx_##x; \
+ __VA_ARGS__ vnet_feature_registration_t tx_##x; \
static void __vnet_add_feature_registration_tx_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_tx_##x (void) \
tx_##x.next = mm->next_feature[VNET_IP_TX_FEAT]; \
mm->next_feature[VNET_IP_TX_FEAT] = &tx_##x; \
} \
-__VA_ARGS__ vnet_ip_feature_registration_t tx_##x
+__VA_ARGS__ vnet_feature_registration_t tx_##x
extern clib_error_t * mpls_feature_init(vlib_main_t * vm);