^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) #ifndef LLC_S_EV_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #define LLC_S_EV_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (c) 1997 by Procom Technology,Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * This program can be redistributed or modified under the terms of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * GNU General Public License as published by the Free Software Foundation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * This program is distributed without any warranty or implied warranty
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * of merchantability or fitness for a particular purpose.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * See the GNU General Public License for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /* Defines SAP component events */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) /* Types of events (possible values in 'ev->type') */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define LLC_SAP_EV_TYPE_SIMPLE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define LLC_SAP_EV_TYPE_CONDITION 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define LLC_SAP_EV_TYPE_PRIM 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define LLC_SAP_EV_TYPE_PDU 4 /* command/response PDU */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define LLC_SAP_EV_TYPE_ACK_TMR 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define LLC_SAP_EV_TYPE_RPT_STATUS 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define LLC_SAP_EV_ACTIVATION_REQ 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define LLC_SAP_EV_RX_UI 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define LLC_SAP_EV_UNITDATA_REQ 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define LLC_SAP_EV_XID_REQ 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define LLC_SAP_EV_RX_XID_C 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define LLC_SAP_EV_RX_XID_R 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define LLC_SAP_EV_TEST_REQ 7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define LLC_SAP_EV_RX_TEST_C 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define LLC_SAP_EV_RX_TEST_R 9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #define LLC_SAP_EV_DEACTIVATION_REQ 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct llc_sap_state_ev {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) u8 prim;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) u8 prim_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) u8 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) u8 reason;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) u8 ind_cfm_flag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct llc_addr saddr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) struct llc_addr daddr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) static __inline__ struct llc_sap_state_ev *llc_sap_ev(struct sk_buff *skb)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) return (struct llc_sap_state_ev *)skb->cb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) struct llc_sap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) typedef int (*llc_sap_ev_t)(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) int llc_sap_ev_activation_req(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) int llc_sap_ev_rx_ui(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) int llc_sap_ev_unitdata_req(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) int llc_sap_ev_xid_req(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) int llc_sap_ev_rx_xid_c(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) int llc_sap_ev_rx_xid_r(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) int llc_sap_ev_test_req(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) int llc_sap_ev_rx_test_c(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) int llc_sap_ev_rx_test_r(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) int llc_sap_ev_deactivation_req(struct llc_sap *sap, struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #endif /* LLC_S_EV_H */