tunnel.h (5101B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 7 * 8 * DO NOT EDIT THIS FILE! 9 * This file is auto-generated. 10 * Edits to this file will be lost when it is regenerated. 11 */ 12 13 #ifndef __BCMX_TUNNEL_H__ 14 #define __BCMX_TUNNEL_H__ 15 16 #if defined(INCLUDE_L3) 17 18 #include <bcm/types.h> 19 #include <bcmx/bcmx.h> 20 #include <bcmx/lplist.h> 21 #include <bcm/tunnel.h> 22 23 /* L3 Tunnel Terminator Structure. */ 24 typedef struct bcmx_tunnel_terminator_s { 25 uint32 flags; /* Configuration flags. */ 26 bcm_vrf_t vrf; /* Virtual router instance. */ 27 bcm_ip_t sip; /* SIP for tunnel header match. */ 28 bcm_ip_t dip; /* DIP for tunnel header match. */ 29 bcm_ip_t sip_mask; /* Source IP mask. */ 30 bcm_ip_t dip_mask; /* Destination IP mask. */ 31 bcm_ip6_t sip6; /* SIP for tunnel header match (IPv6). */ 32 bcm_ip6_t dip6; /* DIP for tunnel header match (IPv6). */ 33 bcm_ip6_t sip6_mask; /* Source IP mask (IPv6). */ 34 bcm_ip6_t dip6_mask; /* Destination IP mask (IPv6). */ 35 uint32 udp_dst_port; /* UDP dst port for UDP packets. */ 36 uint32 udp_src_port; /* UDP src port for UDP packets. */ 37 bcm_tunnel_type_t type; /* Tunnel type. */ 38 bcm_vlan_t vlan; /* The VLAN ID for IPMC lookup or WLAN tunnel. */ 39 bcmx_lplist_t ports; /* Port list for this tunnel. */ 40 bcm_gport_t remote_port; /* Remote termination. */ 41 bcm_gport_t tunnel_id; /* Tunnel id. */ 42 int if_class; /* L3 interface class this tunnel. */ 43 } bcmx_tunnel_terminator_t; 44 45 /* L3 Tunnel Initiator Structure. */ 46 typedef bcm_tunnel_initiator_t bcmx_tunnel_initiator_t; 47 48 /* L3 Tunnel Configuration Structure. */ 49 typedef bcm_tunnel_config_t bcmx_tunnel_config_t; 50 51 /* 52 * Initialize a bcmx_tunnel_terminator_t structure and allocate port 53 * list. 54 */ 55 extern void bcmx_tunnel_terminator_t_init( 56 bcmx_tunnel_terminator_t *info); 57 58 /* Free memory allocated for bcmx_tunnel_terminator_t. */ 59 extern void bcmx_tunnel_terminator_t_free( 60 bcmx_tunnel_terminator_t *info); 61 62 /* Initialize a bcmx_tunnel_initiator_t structure. */ 63 extern void bcmx_tunnel_initiator_t_init( 64 bcmx_tunnel_initiator_t *tunnel); 65 66 /* Initialize a bcmx_tunnel_config_t structure. */ 67 extern void bcmx_tunnel_config_t_init( 68 bcmx_tunnel_config_t *tconfig); 69 70 /* Set the tunneling initiator parameters on an L3 interface. */ 71 extern int bcmx_tunnel_initiator_set( 72 bcmx_l3_intf_t *intf, 73 bcmx_tunnel_initiator_t *tunnel); 74 75 /* Delete the tunnel association for the given L3 interface. */ 76 extern int bcmx_tunnel_initiator_clear( 77 bcmx_l3_intf_t *intf); 78 79 /* Get the tunnel property for the given L3 interface. */ 80 extern int bcmx_tunnel_initiator_get( 81 bcmx_l3_intf_t *intf, 82 bcmx_tunnel_initiator_t *tunnel); 83 84 /* Add a tunnel terminator for DIP-SIP key. */ 85 extern int bcmx_tunnel_terminator_add( 86 bcmx_tunnel_terminator_t *info); 87 88 /* Delete a tunnel terminator for DIP-SIP key. */ 89 extern int bcmx_tunnel_terminator_delete( 90 bcmx_tunnel_terminator_t *info); 91 92 /* Update a tunnel terminator for DIP-SIP key. */ 93 extern int bcmx_tunnel_terminator_update( 94 bcmx_tunnel_terminator_t *info); 95 96 /* Get a tunnel terminator for DIP-SIP key. */ 97 extern int bcmx_tunnel_terminator_get( 98 bcmx_tunnel_terminator_t *info); 99 100 /* Set the valid payload VLANs for this WLAN tunnel. */ 101 extern int bcmx_tunnel_terminator_vlan_set( 102 bcm_gport_t tunnel, 103 bcm_vlan_vector_t vlan_vec); 104 105 /* Get the valid payload VLANs for this WLAN tunnel. */ 106 extern int bcmx_tunnel_terminator_vlan_get( 107 bcm_gport_t tunnel, 108 bcm_vlan_vector_t *vlan_vec); 109 110 /* Create a tunnel DSCP map instance. */ 111 extern int bcmx_tunnel_dscp_map_create( 112 uint32 flags, 113 int *dscp_map_id); 114 115 /* Destroy a tunnel DSCP map instance. */ 116 extern int bcmx_tunnel_dscp_map_destroy( 117 int dscp_map_id); 118 119 /* 120 * Get the { internal priority, color }-to-DSCP mapping in the specified 121 * DSCP map. 122 */ 123 extern int bcmx_tunnel_dscp_map_get( 124 int dscp_map_id, 125 bcm_tunnel_dscp_map_t *dscp_map); 126 127 /* 128 * Set the { internal priority, color }-to-DSCP mapping in the specified 129 * DSCP map. 130 */ 131 extern int bcmx_tunnel_dscp_map_set( 132 int dscp_map_id, 133 bcm_tunnel_dscp_map_t *dscp_map); 134 135 /* Set port egress { internal priority, color }-to-DSCP mapping. */ 136 extern int bcmx_tunnel_dscp_map_port_set( 137 bcmx_lport_t port, 138 bcm_tunnel_dscp_map_t *dscp_map); 139 140 /* Get port egress { internal priority, color }-to-DSCP mapping. */ 141 extern int bcmx_tunnel_dscp_map_port_get( 142 bcmx_lport_t port, 143 bcm_tunnel_dscp_map_t *dscp_map); 144 145 /* Set or get the global chip tunneling configuration. */ 146 extern int bcmx_tunnel_config_get( 147 bcmx_tunnel_config_t *tconfig); 148 149 /* Set or get the global chip tunneling configuration. */ 150 extern int bcmx_tunnel_config_set( 151 bcmx_tunnel_config_t *tconfig); 152 153 #endif /* defined(INCLUDE_L3) */ 154 155 #endif /* __BCMX_TUNNEL_H__ */