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

flow.c (3542B)


      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-2019 Broadcom Inc. All rights reserved.
      7  * Flow structure initializers
      8  */
      9 
     10 #if defined(INCLUDE_L3)
     11 
     12 #include <sal/core/libc.h>
     13  
     14 #include <bcm/flow.h>
     15 
     16 /*
     17  * Function:
     18  *      bcm_flow_logical_field_t_init
     19  * Purpose:
     20  *      Initialize bcm_flow_logical_field_t struct
     21  * Parameters:
     22  *      info - Pointer to the struct to be init'ed
     23  */
     24 void
     25 bcm_flow_logical_field_t_init(bcm_flow_logical_field_t *info)
     26 {
     27     if (info != NULL) {
     28         sal_memset(info, 0, sizeof(*info));
     29     }
     30     return;
     31 }
     32 
     33 /* 
     34  * Function:
     35  *      bcm_flow_match_config_t_init
     36  * Purpose:
     37  *      Initialize flow match config struct
     38  * Parameters: 
     39  *      flow_match - Pointer to the struct to be init'ed
     40  */
     41 void 
     42 bcm_flow_match_config_t_init(bcm_flow_match_config_t *flow_match)
     43 {
     44     if (flow_match != NULL) {
     45         sal_memset(flow_match, 0, sizeof(*flow_match));
     46     }
     47     return;
     48 }
     49 
     50 /* 
     51  * Function:
     52  *      bcm_flow_port_encap_t_init
     53  * Purpose:
     54  *      Initialize flow egress encap struct
     55  * Parameters: 
     56  *      info - Pointer to the struct to be init'ed
     57  */
     58 void
     59 bcm_flow_port_encap_t_init(bcm_flow_port_encap_t *info)
     60 {
     61     if (info != NULL) {
     62         sal_memset(info, 0, sizeof(*info));
     63     }
     64     return;
     65 }
     66 
     67 /*
     68  * Function:
     69  *      bcm_flow_encap_config_t_init
     70  * Purpose:
     71  *      Initialize flow encap config struct
     72  * Parameters:
     73  *      info - Pointer to the struct to be init'ed
     74  */
     75 void
     76 bcm_flow_encap_config_t_init(bcm_flow_encap_config_t *info)
     77 {
     78     if (info != NULL) {
     79         sal_memset(info, 0, sizeof(*info));
     80     }
     81     return;
     82 }
     83 
     84 /*
     85  * Function:
     86  *      bcm_flow_port_t_init
     87  * Purpose:
     88  *      Initialize FLOW  port struct. 
     89  *      To used be before creating the VP.
     90  *   Parameters:
     91  *      flow_port - Pointer to the struct to be init'ed
     92  */
     93 void
     94 bcm_flow_port_t_init(bcm_flow_port_t *flow_port)
     95 {
     96     if (flow_port != NULL) {
     97         sal_memset(flow_port, 0, sizeof(*flow_port));
     98     }   
     99      return;
    100 }
    101 
    102 /* 
    103  * Function:
    104  *      bcm_flow_vpn_config_t_init
    105  * Purpose:
    106  *      Initialize FLOW  vpn config struct
    107  * Parameters: 
    108  *      L2 VPN - Pointer to the struct to be init'ed
    109  */
    110 void
    111 bcm_flow_vpn_config_t_init(bcm_flow_vpn_config_t *l2_vpn)
    112 {
    113     if (l2_vpn != NULL) {
    114         sal_memset(l2_vpn, 0, sizeof(*l2_vpn));
    115     }
    116     return;
    117 }
    118 
    119 /*
    120  * Function:
    121  *      bcm_flow_tunnel_initiator_t_init
    122  * Purpose:
    123  *      Initialize bcm_flow_tunnel_initiator_t struct
    124  * Parameters:
    125  *      info - Pointer to the struct to be init'ed
    126  */
    127 void
    128 bcm_flow_tunnel_initiator_t_init(bcm_flow_tunnel_initiator_t *info)
    129 {
    130     if (info != NULL) {
    131         sal_memset(info, 0, sizeof(*info));
    132     }
    133     return;
    134 }
    135 /*
    136  * Function:
    137  *      bcm_flow_tunnel_terminator_t_init
    138  * Purpose:
    139  *      Initialize bcm_flow_tunnel_terminator_t struct
    140  * Parameters:
    141  *      info - Pointer to the struct to be init'ed
    142  */
    143 void
    144 bcm_flow_tunnel_terminator_t_init(bcm_flow_tunnel_terminator_t *info)
    145 {
    146     if (info != NULL) {
    147         sal_memset(info, 0, sizeof(*info));
    148     }
    149     return;
    150 }
    151 
    152 /*
    153  * Function:
    154  *      bcm_flow_stat_info_t_init
    155  * Purpose:
    156  *      Initialize flow stat info struct
    157  * Parameters:
    158  *      flow_match - Pointer to the struct to be init'ed
    159  */
    160 void
    161 bcm_flow_stat_info_t_init(bcm_flow_stat_info_t *flow_stat)
    162 {
    163     if (flow_stat != NULL) {
    164         sal_memset(flow_stat, 0, sizeof(*flow_stat));
    165     }
    166     return;
    167 }
    168 #else
    169 int _bcm_flow_not_empty;
    170 #endif  /* INCLUDE_L3 */
    171 
    172