1 /*****************************************************************************
2 * if_wanpipe.h Header file for the Sangoma AF_WANPIPE Socket
6 * Copyright: (c) 2000 Sangoma Technologies Inc.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 * ============================================================================
14 * Jan 28, 2000 Nenad Corbic Initial Version
16 *****************************************************************************/
18 #ifndef __LINUX_IF_WAN_PACKET_H
19 #define __LINUX_IF_WAN_PACKET_H
21 struct wan_sockaddr_ll
23 unsigned short sll_family;
24 unsigned short sll_protocol;
26 unsigned short sll_hatype;
27 unsigned char sll_pkttype;
28 unsigned char sll_halen;
29 unsigned char sll_addr[8];
30 unsigned char sll_device[14];
31 unsigned char sll_card[14];
37 unsigned char state_sk;
45 unsigned char d_state;
49 unsigned char cmd_busy;
50 unsigned char command;
56 #define MAX_NUM_DEBUG 10
62 wan_debug_hdr_t debug[MAX_NUM_DEBUG];
65 #define SIOC_WANPIPE_GET_CALL_DATA (SIOCPROTOPRIVATE + 0)
66 #define SIOC_WANPIPE_SET_CALL_DATA (SIOCPROTOPRIVATE + 1)
67 #define SIOC_WANPIPE_ACCEPT_CALL (SIOCPROTOPRIVATE + 2)
68 #define SIOC_WANPIPE_CLEAR_CALL (SIOCPROTOPRIVATE + 3)
69 #define SIOC_WANPIPE_RESET_CALL (SIOCPROTOPRIVATE + 4)
70 #define SIOC_WANPIPE_DEBUG (SIOCPROTOPRIVATE + 5)
71 #define SIOC_WANPIPE_SET_NONBLOCK (SIOCPROTOPRIVATE + 6)
72 #define SIOC_WANPIPE_CHECK_TX (SIOCPROTOPRIVATE + 7)
73 #define SIOC_WANPIPE_SOCK_STATE (SIOCPROTOPRIVATE + 8)
77 #define WAN_PACKET_HOST 0 /* To us */
78 #define WAN_PACKET_BROADCAST 1 /* To all */
79 #define WAN_PACKET_MULTICAST 2 /* To group */
80 #define WAN_PACKET_OTHERHOST 3 /* To someone else */
81 #define WAN_PACKET_OUTGOING 4 /* Outgoing of any type */
82 /* These ones are invisible by user level */
83 #define WAN_PACKET_LOOPBACK 5 /* MC/BRD frame looped back */
84 #define WAN_PACKET_FASTROUTE 6 /* Fastrouted frame */
88 #define WAN_PACKET_DATA 7
89 #define WAN_PACKET_CMD 8
90 #define WAN_PACKET_ASYNC 9
91 #define WAN_PACKET_ERR 10
93 /* Packet socket options */
95 #define WAN_PACKET_ADD_MEMBERSHIP 1
96 #define WAN_PACKET_DROP_MEMBERSHIP 2
98 #define WAN_PACKET_MR_MULTICAST 0
99 #define WAN_PACKET_MR_PROMISC 1
100 #define WAN_PACKET_MR_ALLMULTI 2
104 /* Private wanpipe socket structures. */
107 void *mbox; /* Mail box */
108 void *card; /* Card bouded to */
109 struct net_device *dev; /* Bounded device */
110 unsigned short lcn; /* Binded LCN */
111 unsigned char svc; /* 0=pvc, 1=svc */
112 unsigned char timer; /* flag for delayed transmit*/
113 struct timer_list tx_timer;
115 unsigned char force; /* Used to force sock release */
116 atomic_t packet_sent;
120 #define wp_sk(__sk) ((struct wanpipe_opt *)(__sk)->sk_protinfo)