36 #include <sys/cpuvar.h> |
35 #include <sys/cpuvar.h> |
37 #include <sys/callb.h> |
36 #include <sys/callb.h> |
38 #include <sys/list.h> |
37 #include <sys/list.h> |
39 #include <sys/mac_client.h> |
38 #include <sys/mac_client.h> |
40 #include <sys/mac_client_priv.h> |
39 #include <sys/mac_client_priv.h> |
|
40 #include <sys/mac_flow.h> |
41 |
41 |
42 static int str_constructor(void *, void *, int); |
42 static int str_constructor(void *, void *, int); |
43 static void str_destructor(void *, void *); |
43 static void str_destructor(void *, void *); |
44 static mblk_t *str_unitdata_ind(dld_str_t *, mblk_t *, boolean_t); |
44 static mblk_t *str_unitdata_ind(dld_str_t *, mblk_t *, boolean_t); |
45 static void str_notify_promisc_on_phys(dld_str_t *); |
45 static void str_notify_promisc_on_phys(dld_str_t *); |
1717 dlip->dl_notification = DL_NOTE_FASTPATH_FLUSH; |
1717 dlip->dl_notification = DL_NOTE_FASTPATH_FLUSH; |
1718 |
1718 |
1719 qreply(dsp->ds_wq, mp); |
1719 qreply(dsp->ds_wq, mp); |
1720 } |
1720 } |
1721 |
1721 |
|
1722 static void |
|
1723 str_notify_allowed_ips(dld_str_t *dsp) |
|
1724 { |
|
1725 mblk_t *mp; |
|
1726 dl_notify_ind_t *dlip; |
|
1727 size_t mp_size; |
|
1728 mac_protect_t mrp; |
|
1729 |
|
1730 if (!(dsp->ds_notifications & DL_NOTE_ALLOWED_IPS)) |
|
1731 return; |
|
1732 |
|
1733 mp_size = sizeof (mac_protect_t) + sizeof (dl_notify_ind_t); |
|
1734 if ((mp = mexchange(dsp->ds_wq, NULL, mp_size, M_PROTO, 0)) == NULL) |
|
1735 return; |
|
1736 |
|
1737 mac_protect_get(dsp->ds_mh, &mrp); |
|
1738 bzero(mp->b_rptr, mp_size); |
|
1739 dlip = (dl_notify_ind_t *)mp->b_rptr; |
|
1740 dlip->dl_primitive = DL_NOTIFY_IND; |
|
1741 dlip->dl_notification = DL_NOTE_ALLOWED_IPS; |
|
1742 dlip->dl_data = 0; |
|
1743 dlip->dl_addr_offset = sizeof (dl_notify_ind_t); |
|
1744 dlip->dl_addr_length = sizeof (mac_protect_t); |
|
1745 bcopy(&mrp, mp->b_rptr + sizeof (dl_notify_ind_t), |
|
1746 sizeof (mac_protect_t)); |
|
1747 |
|
1748 qreply(dsp->ds_wq, mp); |
|
1749 } |
|
1750 |
1722 /* |
1751 /* |
1723 * MAC notification callback. |
1752 * MAC notification callback. |
1724 */ |
1753 */ |
1725 void |
1754 void |
1726 str_notify(void *arg, mac_notify_type_t type) |
1755 str_notify(void *arg, mac_notify_type_t type) |