OpenNSL API Guide and Reference Manual
Data Structures | Files | Macros | Typedefs | Enumerations | Functions
Policer

Data Structures

struct  opennsl_policer_config_s
 

Files

file  policer.h
 
file  policerX.h
 

Macros

#define OPENNSL_POLICER_COLOR_BLIND   0x00000004
 
#define OPENNSL_POLICER_MODE_BYTES   0x00000040
 
#define OPENNSL_POLICER_MODE_PACKETS   0x00000080
 

Typedefs

typedef struct
opennsl_policer_config_s 
opennsl_policer_config_t
 
typedef enum opennsl_policer_mode_e opennsl_policer_mode_t
 Policer Modes.
 

Enumerations

enum  opennsl_policer_mode_e {
  opennslPolicerModeSrTcm = 0,
  opennslPolicerModeCommitted = 1,
  opennslPolicerModePeak = 2,
  opennslPolicerModeTrTcm = 3,
  opennslPolicerModeTrTcmDs = 4
}
 Policer Modes. More...
 

Functions

void opennsl_policer_config_t_init (opennsl_policer_config_t *pol_cfg) LIB_DLL_EXPORTED
 Initialize a policer configuration structure.
 
int opennsl_policer_create (int unit, opennsl_policer_config_t *pol_cfg, opennsl_policer_t *policer_id) LIB_DLL_EXPORTED
 Create a policer entry.
 
int opennsl_policer_destroy (int unit, opennsl_policer_t policer_id) LIB_DLL_EXPORTED
 Destroy a policer entry.
 
int opennsl_policer_get (int unit, opennsl_policer_t policer_id, opennsl_policer_config_t *pol_cfg) LIB_DLL_EXPORTED
 Get the config settings for a policer entry.
 
int opennsl_policer_set (int unit, opennsl_policer_t policer_id, opennsl_policer_config_t *pol_cfg) LIB_DLL_EXPORTED
 Set the config settings for a policer entry.
 

Detailed Description

Macro Definition Documentation

#define OPENNSL_POLICER_COLOR_BLIND   0x00000004

Definition at line 31 of file policerX.h.

Referenced by example_create_policer().

#define OPENNSL_POLICER_MODE_BYTES   0x00000040

Definition at line 32 of file policerX.h.

#define OPENNSL_POLICER_MODE_PACKETS   0x00000080

Definition at line 33 of file policerX.h.

Typedef Documentation

Policer Modes.

Enumeration Type Documentation

Policer Modes.

Enumerator:
opennslPolicerModeSrTcm 

RFC 2697.

opennslPolicerModeCommitted 
opennslPolicerModePeak 
opennslPolicerModeTrTcm 

RFC 2698.

opennslPolicerModeTrTcmDs 

RFC 4115, TrTcmModified.

Definition at line 22 of file policerX.h.

Function Documentation

void opennsl_policer_config_t_init ( opennsl_policer_config_t pol_cfg)

Initialize a policer configuration structure.

Description
Initialize a policer configuration structure.
Parameters
pol_cfg[IN,OUT] Pointer to policer configuration structure to initialize.
Return values
None.

Referenced by example_create_meter(), and example_create_policer().

int opennsl_policer_create ( int  unit,
opennsl_policer_config_t pol_cfg,
opennsl_policer_t policer_id 
)

Create a policer entry.

Description
Create a policer entry.
Parameters
unit[IN] Unit number.
pol_cfg[IN] Policer config
policer_id[IN,OUT] Policer ID
Return values
OPENNSL_E_XXX

Referenced by example_create_meter(), and example_create_policer().

int opennsl_policer_destroy ( int  unit,
opennsl_policer_t  policer_id 
)

Destroy a policer entry.

Description
Destroy a policer entry. A policer entry has the following restrictions before it can be destroyed.
  1. The Policer should be detached from all the entries 2. Detaching the policer from the entry does not clear the policer and meter entries from the hardware. So, the entry must be re-installed or removed before policer destroy.
Parameters
unit[IN] Unit number.
policer_id[IN] Policer ID
Return values
OPENNSL_E_XXX
int opennsl_policer_get ( int  unit,
opennsl_policer_t  policer_id,
opennsl_policer_config_t pol_cfg 
)

Get the config settings for a policer entry.

Description
Get the config settings for a policer entry.
Parameters
unit[IN] Unit number.
policer_id[IN] Policer ID.
pol_cfg[OUT] Policer configuration.
Return values
OPENNSL_E_XXX
int opennsl_policer_set ( int  unit,
opennsl_policer_t  policer_id,
opennsl_policer_config_t pol_cfg 
)

Set the config settings for a policer entry.

Description
Set the config settings for a policer entry.
Parameters
unit[IN] Unit number.
policer_id[IN] Policer ID.
pol_cfg[IN] Policer configuration.
Return values
OPENNSL_E_XXX