0001
0002
0003
0004
0005
0006
0007 #define DEBUG_L1OIP_INIT 0x00010000
0008 #define DEBUG_L1OIP_SOCKET 0x00020000
0009 #define DEBUG_L1OIP_MGR 0x00040000
0010 #define DEBUG_L1OIP_MSG 0x00080000
0011
0012
0013
0014
0015
0016
0017
0018 #define L1OIP_MAX_LEN 2048
0019 #define L1OIP_MAX_PERFRAME 1400
0020
0021
0022
0023 #define L1OIP_KEEPALIVE 15
0024 #define L1OIP_TIMEOUT 65
0025
0026
0027
0028 #define L1OIP_DEFAULTPORT 931
0029
0030
0031
0032 struct l1oip_chan {
0033 struct dchannel *dch;
0034 struct bchannel *bch;
0035 u32 tx_counter;
0036 u32 rx_counter;
0037 u32 codecstate;
0038 #ifdef REORDER_DEBUG
0039 int disorder_flag;
0040 struct sk_buff *disorder_skb;
0041 u32 disorder_cnt;
0042 #endif
0043 };
0044
0045
0046
0047 struct l1oip {
0048 struct list_head list;
0049
0050
0051 int registered;
0052 char name[MISDN_MAX_IDLEN];
0053 int idx;
0054 int pri;
0055 int d_idx;
0056 int b_num;
0057 u32 id;
0058 int ondemand;
0059 int bundle;
0060 int codec;
0061 int limit;
0062
0063
0064 struct timer_list keep_tl;
0065 struct timer_list timeout_tl;
0066 int timeout_on;
0067 struct work_struct workq;
0068
0069
0070 struct socket *socket;
0071 struct completion socket_complete;
0072 struct task_struct *socket_thread;
0073 spinlock_t socket_lock;
0074 u32 remoteip;
0075 u16 localport;
0076 u16 remoteport;
0077 struct sockaddr_in sin_local;
0078 struct sockaddr_in sin_remote;
0079 struct msghdr sendmsg;
0080 struct kvec sendiov;
0081
0082
0083 struct l1oip_chan chan[128];
0084 };
0085
0086 extern int l1oip_law_to_4bit(u8 *data, int len, u8 *result, u32 *state);
0087 extern int l1oip_4bit_to_law(u8 *data, int len, u8 *result);
0088 extern int l1oip_alaw_to_ulaw(u8 *data, int len, u8 *result);
0089 extern int l1oip_ulaw_to_alaw(u8 *data, int len, u8 *result);
0090 extern void l1oip_4bit_free(void);
0091 extern int l1oip_4bit_alloc(int ulaw);