Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cint_reset();
- int my_callback(
- int unit,
- bcm_port_t port,
- bcm_macsec_event_t event,
- int chanId,
- int assocId,
- void *user_data)
- {
- int e = event;
- /*bcm_macsec_secure_assoc_t */ void *assoc;
- printf("u=%d p=%d e=%d c=%d a=%d userd=%p\n",
- unit,port, e,chanId, assocId, user_data );
- /* Hard expiry */
- if (e == BCM_MACSEC_EVENT_KEY_EXPIRED) {
- char buf[128] = {0};
- int u = 0;
- /* u = (int) user_data ; */
- /* SA create to turn off Active flag */
- sprintf(buf, " ms sac %d.0 AssocID=%d ChanID=%d FLAgs= ",
- u, assocId, chanId);
- bshell(0, buf);
- }
- return 0;
- }
- {
- int bcm_gport;
- int unit = 0;
- int port = 1;
- int rv =0;
- for (port = 19 ; port < 20 ; port++) {
- rv = bcm_macsec_event_register(unit, my_callback, (void *) 0 );
- printf("rv = %d\n", rv);
- rv = bcm_macsec_event_enable_set(unit, BCM_MACSEC_EVENT_PRE_KEY_EXPIRE, 1);
- printf("rv = %d\n", rv);
- rv = bcm_macsec_event_enable_set(unit, BCM_MACSEC_EVENT_KEY_EXPIRED, 1);
- printf("rv = %d\n", rv);
- rv = bcm_macsec_event_enable_set(unit, BCM_MACSEC_EVENT_KEY_RENEWED, 1);
- printf("rv = %d\n", rv);
- rv = bcm_macsec_event_enable_set(unit, BCM_MACSEC_EVENT_HW_FAILURE, 1);
- printf("rv = %d\n", rv);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement