openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

ipmc.c (1676B)


      1 /*
      2  * 
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      6  */
      7 
      8 #ifdef INCLUDE_L3
      9 
     10 #include <soc/drv.h>
     11 #include <soc/mem.h>
     12 
     13 #include <bcm/error.h>
     14 #include <bcm/ipmc.h>
     15 #include <bcm/stat.h>
     16 #include <bcm/vlan.h>
     17 #include <bcm/debug.h>
     18 
     19 /*
     20  * Function:
     21  *	bcm_ipmc_addr_t_init
     22  * Description:
     23  *	Initialize a bcm_ipmc_addr_t to a specified source IP address,
     24  *	destination IP address and VLAN, while zeroing all other fields.
     25  * Parameters:
     26  *	data - Pointer to bcm_ipmc_addr_t.
     27  * Returns:
     28  *	Nothing.
     29  */
     30 
     31 void
     32 bcm_ipmc_addr_t_init(bcm_ipmc_addr_t *data)
     33 {
     34     if (NULL != data) {
     35         sal_memset(data, 0, sizeof(bcm_ipmc_addr_t));
     36         data->rp_id = BCM_IPMC_RP_ID_INVALID;
     37         data->ing_intf = BCM_IF_INVALID;
     38     }
     39 }
     40 
     41 /*
     42  * Function:
     43  *      bcm_ipmc_counters_t_init
     44  * Description:
     45  *      Initialize a ipmc counters object struct.
     46  * Parameters:
     47  *      ipmc_counter - Pointer to IPMC counters object struct.
     48  * Returns:
     49  *      Nothing.
     50  */
     51 void
     52 bcm_ipmc_counters_t_init(bcm_ipmc_counters_t *ipmc_counter)
     53 {
     54     if (ipmc_counter != NULL) {
     55         sal_memset(ipmc_counter, 0, sizeof(*ipmc_counter));
     56     }
     57     return;
     58 }
     59 
     60 /*
     61  * Function:
     62  *	bcm_ipmc_range_t_init
     63  * Description:
     64  *	Initialize a bcm_ipmc_range_t to all zeroes.
     65  * Parameters:
     66  *	data - Pointer to bcm_ipmc_range_t.
     67  * Returns:
     68  *	Nothing.
     69  */
     70 void
     71 bcm_ipmc_range_t_init(bcm_ipmc_range_t *range)
     72 {
     73     if (NULL != range) {
     74         sal_memset(range, 0, sizeof(bcm_ipmc_range_t));
     75     }
     76 }
     77 
     78 #else 
     79 int _bcm_ipmc_not_empty;
     80 #endif  /* INCLUDE_L3 */
     81