auth.h (4811B)
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 * DO NOT EDIT THIS FILE! 9 * This file is auto-generated. 10 * Edits to this file will be lost when it is regenerated. 11 */ 12 13 #ifndef __BCM_AUTH_H__ 14 #define __BCM_AUTH_H__ 15 16 #include <bcm/types.h> 17 18 #define BCM_AUTH_MODE_UNCONTROLLED 0x00000001 19 #define BCM_AUTH_MODE_UNAUTH 0x00000002 20 #define BCM_AUTH_MODE_AUTH 0x00000004 21 22 #define BCM_AUTH_BLOCK_IN 0x00000008 23 #define BCM_AUTH_BLOCK_INOUT 0x00000010 24 25 #define BCM_AUTH_LEARN 0x00000020 26 #define BCM_AUTH_IGNORE_LINK 0x00000040 27 #define BCM_AUTH_IGNORE_VIOLATION 0x00000080 28 #define BCM_AUTH_DROP_UNKNOWN 0x00000100 29 30 #define BCM_AUTH_REASON_UNKNOWN 0x00002000 31 #define BCM_AUTH_REASON_LINK 0x00004000 32 #define BCM_AUTH_REASON_VIOLATION 0x00008000 33 34 #ifndef BCM_HIDE_DISPATCHABLE 35 36 /* Initialize bcm_auth API module. */ 37 extern int bcm_auth_init( 38 int unit); 39 40 /* De-configure bcm_auth API module. */ 41 extern int bcm_auth_detach( 42 int unit); 43 44 /* Sets or gets authorization operating mode. */ 45 extern int bcm_auth_mode_set( 46 int unit, 47 int port, 48 uint32 mode); 49 50 /* Sets or gets authorization operating mode. */ 51 extern int bcm_auth_mode_get( 52 int unit, 53 int port, 54 uint32 *modep); 55 56 #endif /* BCM_HIDE_DISPATCHABLE */ 57 58 /* Definition for 802.1X callout functions. */ 59 typedef void (*bcm_auth_cb_t)( 60 void *cookie, 61 int unit, 62 int port, 63 int reason); 64 65 #ifndef BCM_HIDE_DISPATCHABLE 66 67 /* 68 * Register a callback function to be called when a port becomes 69 * asynchronously unauthorized. 70 */ 71 extern int bcm_auth_unauth_callback( 72 int unit, 73 bcm_auth_cb_t func, 74 void *cookie); 75 76 /* Enable/disable the ability of packets to be sent out a port. */ 77 extern int bcm_auth_egress_set( 78 int unit, 79 int port, 80 int enable); 81 82 /* Enable/disable the ability of packets to be sent out a port. */ 83 extern int bcm_auth_egress_get( 84 int unit, 85 int port, 86 int *enable); 87 88 /* Add Switch's MAC address. */ 89 extern int bcm_auth_mac_add( 90 int unit, 91 int port, 92 bcm_mac_t mac); 93 94 /* Remove Switch's MAC address. */ 95 extern int bcm_auth_mac_delete( 96 int unit, 97 int port, 98 bcm_mac_t mac); 99 100 /* Remove Switch's MAC address. */ 101 extern int bcm_auth_mac_delete_all( 102 int unit, 103 int port); 104 105 #endif /* BCM_HIDE_DISPATCHABLE */ 106 107 /* Features that can be controlled for EAP packets. */ 108 typedef enum bcm_auth_mac_control_e { 109 bcmEapControlL2UserAddr = 0, /* enable L2 User Address frame bypass EAP 110 Port State Filter and SA Filter. */ 111 bcmEapControlDHCP = 1, /* enable DHCP frame bypass EAP Port State 112 Filter and SA Filter. */ 113 bcmEapControlARP = 2, /* enable ARP frame bypass EAP Port State 114 Filter and SA Filter. */ 115 bcmEapControlMAC2X = 3, /* enable(DA=01-80-c2-00-00-22,23,....,2f) 116 frame bypass EAP Port State Filter and SA 117 Filter. */ 118 bcmEapControlGVRP = 4, /* enable(DA=01-80-c2-00-00-21) frame bypass 119 EAP Port State FIlter and SA Filter. */ 120 bcmEapControlGMRP = 5, /* enable(DA=01-80-c2-00-00-20) frame bypass 121 EAP Port State FIlter and SA Filter. */ 122 bcmEapControlMAC1X = 6, /* enable(DA=01-80-c2-00-00-11,12,....,1f) 123 frame bypass EAP Port State FIlter and SA 124 Filter. */ 125 bcmEapControlAllBridges = 7, /* enable(DA=01-80-c2-00-00-10) frame bypass 126 EAP Port State FIlter and SA Filter. */ 127 bcmEapControlMAC0X = 8, /* enable(DA=01-80-c2-00-00-02)or 128 (DA=01-80-c2-00-00-04,05,....,0f) frame 129 bypass EAP Port State FIlter and SA 130 Filter. */ 131 bcmEapControlMACBPDU = 9 /* enable BPDU frame bypass EAP Port State 132 FIlter and SA Filter. */ 133 } bcm_auth_mac_control_t; 134 135 #ifndef BCM_HIDE_DISPATCHABLE 136 137 /* Set to control bypass for an EAP mac control type. */ 138 extern int bcm_auth_mac_control_set( 139 int unit, 140 bcm_auth_mac_control_t type, 141 uint32 value); 142 143 /* Get the EAP control status for an auth mac control type. */ 144 extern int bcm_auth_mac_control_get( 145 int unit, 146 bcm_auth_mac_control_t type, 147 uint32 *value); 148 149 #endif /* BCM_HIDE_DISPATCHABLE */ 150 151 #endif /* __BCM_AUTH_H__ */