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

bregex.c (1838B)


      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  * File:       bregex.c
      8  * Purpose:    Regex common APIs
      9  */
     10 
     11 #include <soc/drv.h>
     12 #include <bcm/bregex.h>
     13 
     14 #if defined(INCLUDE_REGEX)
     15 
     16 void
     17 bcm_regex_config_t_init(bcm_regex_config_t *config)
     18 {
     19     if (NULL != config) {
     20         sal_memset(config, 0, sizeof(*config));
     21         config->max_flows = -1;
     22         config->payload_depth = 1500;
     23         config->inspect_num_pkt = 1;
     24         config->report_buffer_size = 1024;
     25     }
     26 
     27     return;
     28 }
     29 
     30 void
     31 bcm_regex_engine_config_t_init(bcm_regex_engine_config_t *config)
     32 {
     33     if (NULL != config) {
     34         sal_memset(config, 0, sizeof(bcm_regex_engine_config_t));
     35     }
     36     return;
     37 }
     38 
     39 void
     40 bcm_regex_match_t_init(bcm_regex_match_t *match)
     41 {
     42     if (NULL != match) {
     43         sal_memset(match, 0, sizeof(bcm_regex_match_t));
     44         match->payload_length_max = -1;
     45         match->payload_length_min = -1;
     46         match->policer_id = -1;
     47         match->requires = -1;
     48         match->provides = -1;
     49         match->sequence = -1;
     50         match->policy_id = -1;
     51     }
     52     return;
     53 }
     54 
     55 
     56 void
     57 bcm_regex_report_t_init(bcm_regex_report_t *report)
     58 {
     59     if (NULL != report) {
     60         sal_memset(report, 0, sizeof(bcm_regex_report_t));
     61     }
     62     return;
     63 }
     64 
     65 /* Initialize regex session key structure. */
     66 void bcm_regex_session_key_t_init(
     67     bcm_regex_session_key_t *session_key)
     68 {
     69     if (NULL != session_key) {
     70         sal_memset(session_key, 0, sizeof(*session_key));
     71     }
     72 }
     73 
     74 /* Initialize regex session structure. */
     75 void bcm_regex_session_t_init(
     76     bcm_regex_session_t *session)
     77 {
     78     if (NULL != session) {
     79         sal_memset(session, 0, sizeof(*session));
     80     }
     81 }
     82 
     83 #endif /* INCLUDE_REGEX */
     84