macsec_cmn.h (4345B)
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 #ifndef MACSEC_CMN_H 9 #define MACSEC_CMN_H 10 11 #if defined(INCLUDE_MACSEC) 12 13 #include <bcm/macsec.h> 14 15 extern int 16 _bcm_common_macsec_init(int unit); 17 18 extern int 19 bcm_common_macsec_port_traverse(int unit, 20 bcm_macsec_port_traverse_cb callback, 21 void *user_data); 22 extern int 23 bcm_common_macsec_port_config_set(int unit, bcm_port_t port, 24 bcm_macsec_port_config_t *cfg); 25 26 extern int 27 bcm_common_macsec_port_config_get(int unit, bcm_port_t port, 28 bcm_macsec_port_config_t *cfg); 29 30 extern int 31 bcm_common_macsec_secure_chan_create(int unit, bcm_port_t port, 32 uint32 flags, 33 bcm_macsec_secure_chan_t *chan, 34 int *chanId); 35 36 extern int 37 bcm_common_macsec_secure_chan_get(int unit, bcm_port_t port, int chanId, 38 bcm_macsec_secure_chan_t *chan); 39 40 extern int 41 bcm_common_macsec_secure_chan_destroy(int unit, bcm_port_t port, int chanId); 42 43 extern int 44 bcm_common_macsec_secure_chan_traverse(int unit, bcm_port_t port, 45 bcm_macsec_chan_traverse_cb callback, 46 void *user_data); 47 extern int 48 bcm_common_macsec_secure_assoc_create(int unit, bcm_port_t port, 49 uint32 flags, int chanId, 50 bcm_macsec_secure_assoc_t *assoc, 51 int *assocId); 52 53 extern int 54 bcm_common_macsec_secure_assoc_get(int unit, bcm_port_t port, int assocId, 55 bcm_macsec_secure_assoc_t *assoc, int *chanId); 56 57 extern int 58 bcm_common_macsec_secure_assoc_destroy(int unit, 59 bcm_port_t port, int assocId); 60 61 extern int 62 bcm_common_macsec_secure_assoc_traverse(int unit, bcm_port_t port, 63 int chanId, 64 bcm_macsec_secure_assoc_traverse_cb callback, 65 void *user_data); 66 67 extern int 68 bcm_common_macsec_flow_create(int unit, bcm_port_t port, 69 uint32 flags, bcm_macsec_flow_match_t *flow, 70 bcm_macsec_flow_action_t *action, int *flowId); 71 72 extern int 73 bcm_common_macsec_flow_get(int unit, bcm_port_t port, int flowId, 74 bcm_macsec_flow_match_t *flow, 75 bcm_macsec_flow_action_t *action); 76 77 extern int 78 bcm_common_macsec_flow_destroy(int unit, bcm_port_t port, int flowId); 79 80 extern int 81 bcm_common_macsec_flow_traverse(int unit, bcm_port_t port, 82 bcm_macsec_flow_traverse_cb callbk, 83 void *user_data); 84 85 extern int 86 bcm_common_macsec_stat_clear(int unit, bcm_port_t port); 87 88 extern int 89 bcm_common_macsec_stat_get(int unit, bcm_port_t port, 90 bcm_macsec_stat_t stat, 91 int chanId, int assocId, uint64 *val); 92 93 extern int 94 bcm_common_macsec_stat_get32(int unit, bcm_port_t port, 95 bcm_macsec_stat_t stat, int chanId, 96 int assocId, uint32 *val); 97 98 extern int 99 bcm_common_macsec_stat_set(int unit, bcm_port_t port, 100 bcm_macsec_stat_t stat, 101 int chanId, int assocId, uint64 val); 102 103 extern int 104 bcm_common_macsec_stat_set32(int unit, bcm_port_t port, 105 bcm_macsec_stat_t stat, 106 int chanId, int assocId, uint32 val); 107 108 extern int 109 bcm_common_macsec_event_register(int unit, bcm_macsec_event_cb cb, void *user_data); 110 111 extern int 112 bcm_common_macsec_event_unregister(int unit, bcm_macsec_event_cb cb); 113 114 extern int 115 bcm_common_macsec_event_enable_set(int unit, 116 bcm_macsec_event_t event, int enable); 117 118 extern int 119 bcm_common_macsec_event_enable_get(int unit, 120 bcm_macsec_event_t event, int *enable); 121 122 /* 123 * Debug/Print config set/get. 124 */ 125 extern int bcm_common_macsec_config_print(uint32 level); 126 127 #endif /* defined(INCLUDE_MACSEC) */ 128 129 #endif /* MACSEC_CMN_H */ 130