1
2
3
4
5
6
7 #define DEBUG_L1OIP_INIT 0x00010000
8 #define DEBUG_L1OIP_SOCKET 0x00020000
9 #define DEBUG_L1OIP_MGR 0x00040000
10 #define DEBUG_L1OIP_MSG 0x00080000
11
12
13
14
15
16
17
18 #define L1OIP_MAX_LEN 2048
19 #define L1OIP_MAX_PERFRAME 1400
20
21
22
23 #define L1OIP_KEEPALIVE 15
24 #define L1OIP_TIMEOUT 65
25
26
27
28 #define L1OIP_DEFAULTPORT 931
29
30
31
32 struct l1oip_chan {
33 struct dchannel *dch;
34 struct bchannel *bch;
35 u32 tx_counter;
36 u32 rx_counter;
37 u32 codecstate;
38 #ifdef REORDER_DEBUG
39 int disorder_flag;
40 struct sk_buff *disorder_skb;
41 u32 disorder_cnt;
42 #endif
43 };
44
45
46
47 struct l1oip {
48 struct list_head list;
49
50
51 int registered;
52 char name[MISDN_MAX_IDLEN];
53 int idx;
54 int pri;
55 int d_idx;
56 int b_num;
57 u32 id;
58 int ondemand;
59 int bundle;
60 int codec;
61 int limit;
62
63
64 struct timer_list keep_tl;
65 struct timer_list timeout_tl;
66 int timeout_on;
67 struct work_struct workq;
68
69
70 struct socket *socket;
71 struct completion socket_complete;
72 struct task_struct *socket_thread;
73 spinlock_t socket_lock;
74 u32 remoteip;
75 u16 localport;
76 u16 remoteport;
77 struct sockaddr_in sin_local;
78 struct sockaddr_in sin_remote;
79 struct msghdr sendmsg;
80 struct kvec sendiov;
81
82
83 struct l1oip_chan chan[128];
84 };
85
86 extern int l1oip_law_to_4bit(u8 *data, int len, u8 *result, u32 *state);
87 extern int l1oip_4bit_to_law(u8 *data, int len, u8 *result);
88 extern int l1oip_alaw_to_ulaw(u8 *data, int len, u8 *result);
89 extern int l1oip_ulaw_to_alaw(u8 *data, int len, u8 *result);
90 extern void l1oip_4bit_free(void);
91 extern int l1oip_4bit_alloc(int ulaw);