ipmc.h (3639B)
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_IPMC_H__ 14 #define __BCMX_IPMC_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/ipmc.h> 22 23 /* IPMC address type. */ 24 typedef struct bcmx_ipmc_addr_s { 25 bcm_ip_t s_ip_addr; /* IPv4 Source address. */ 26 bcm_ip_t mc_ip_addr; /* IPv4 Destination address. */ 27 bcm_ip6_t s_ip6_addr; /* IPv6 Source address. */ 28 bcm_ip6_t mc_ip6_addr; /* IPv6 Destination address. */ 29 bcm_vlan_t vid; /* VLAN identifier. */ 30 bcm_vrf_t vrf; /* Virtual Router Instance. */ 31 bcm_cos_t cos; /* COS based on dst IP multicast addr. */ 32 bcmx_lplist_t l2_ports; /* L2 Port list. */ 33 bcmx_lplist_t l2_untag_ports; /* L2 Untag port list. */ 34 bcmx_lplist_t l3_ports; /* L3 Port list. */ 35 int ts; /* Source port or TGID bit. */ 36 bcmx_lport_t port_tgid; /* Source port or TGID. */ 37 int v; /* Valid bit. */ 38 int ipmc_index; /* Use this index to program IPMC table for 39 XGS chips based on flags value */ 40 uint32 flags; /* See BCM_IPMC_XXX flag definitions. */ 41 int lookup_class; /* Classification lookup class ID. */ 42 } bcmx_ipmc_addr_t; 43 44 /* Initialize the IPMC subsystem. */ 45 extern int bcmx_ipmc_init(void); 46 47 /* Detach the IPMC subsystem. */ 48 extern int bcmx_ipmc_detach(void); 49 50 /* Enable/disable IPMC support. */ 51 extern int bcmx_ipmc_enable( 52 int enable); 53 54 /* Initialize bcmx_ipmc_addr_t and allocate port lists. */ 55 extern void bcmx_ipmc_addr_t_init( 56 bcmx_ipmc_addr_t *data); 57 58 /* Deallocate port lists in bcmx_ipmc_addr_t. */ 59 extern void bcmx_ipmc_addr_t_free( 60 bcmx_ipmc_addr_t *data); 61 62 /* Backward compatibility. */ 63 #define bcmx_ipmc_addr_free bcmx_ipmc_addr_t_free 64 65 /* Add new IPMC group. */ 66 extern int bcmx_ipmc_add( 67 bcmx_ipmc_addr_t *data); 68 69 /* Find info of an IPMC group. */ 70 extern int bcmx_ipmc_find( 71 bcmx_ipmc_addr_t *data); 72 73 /* Remove IPMC group. */ 74 extern int bcmx_ipmc_remove( 75 bcmx_ipmc_addr_t *data); 76 77 /* Remove all IPMC groups. */ 78 extern int bcmx_ipmc_remove_all(void); 79 80 /* Reinitialize/clear the egress IP multicast configuration. */ 81 extern int bcmx_ipmc_egress_port_init(void); 82 83 /* Configure the IP Multicast egress properties. */ 84 extern int bcmx_ipmc_egress_port_set( 85 bcmx_lport_t port, 86 const bcm_mac_t mac, 87 int untag, 88 bcm_vlan_t vid, 89 int ttl_threshold); 90 91 /* Get the egress IP multicast configuration properties. */ 92 extern int bcmx_ipmc_egress_port_get( 93 bcmx_lport_t port, 94 bcm_mac_t mac, 95 int *untag, 96 bcm_vlan_t *vid, 97 int *ttl_threshold); 98 99 /* Get the combined IP multicast statistics. */ 100 extern int bcmx_ipmc_counters_get( 101 bcmx_lport_t port, 102 bcm_ipmc_counters_t *counters); 103 104 /* Age unused ipmc table entries. */ 105 extern int bcmx_ipmc_age( 106 uint32 flags, 107 bcm_ipmc_traverse_cb age_cb, 108 void *user_data); 109 110 /* 111 * Traverse through the ipmc table and run callback at each valid ipmc 112 * entry. 113 */ 114 extern int bcmx_ipmc_traverse( 115 uint32 flags, 116 bcm_ipmc_traverse_cb cb, 117 void *user_data); 118 119 #endif /* defined(INCLUDE_L3) */ 120 121 #endif /* __BCMX_IPMC_H__ */