Q931ToPcap: Changed predefined ethernet frames in writeQ931... function from local to global variables.

This should speed things up a bit.


git-svn-id: http://svn.openzap.org/svn/openzap/trunk@631 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Helmut Kuper 2009-01-31 10:23:23 +00:00
parent e2658cb9d9
commit 5da3ac8de6

View File

@ -78,7 +78,29 @@ pcap_t *pcaphandle = NULL;
char *pcapfn = NULL;
int do_q931ToPcap= 0;
/*Predefined Ethernet Frame with Q931-over-IP encapsulated - From remote TDM host to FreeSWITCH*/
L3UCHAR recFrame[SNAPLEN]= {
/*IEEE 802.3 VLAN 802.1q Ethernet Frame Header*/
2,0,1,0xAA,0xAA,0xAA,2,0,1,0xBB,0xBB,0xBB,0x81,0,0xE0,0,0x08,0,
/*IPv4 Header (minimal size; no options)*/
0x45,0,0,44,0,0,0,0,64,6,0,0,2,2,2,2,1,1,1,1,
/*TCP-Header*/
0,0x66,0,0x66,0,0,0,0,0,0,0,0,0x50,0,0,1,0,0,0,0,
/*TPKT-Header RFC 1006*/
3,0,0,0
};
/*Predefined Ethernet Frame with Q931-over-IP encapsulated - Frome FreeSWITCH to remote TDM host*/
L3UCHAR sendFrame[SNAPLEN]= {
/*IEEE 802.3 VLAN 802.1q Ethernet Frame Header*/
2,0,1,0xBB,0xBB,0xBB,2,0,1,0xAA,0xAA,0xAA,0x81,0,0xE0,0,0x08,0,
/*IPv4 Header (minimal size; no options)*/
0x45,0,0,44,0,0,0,0,64,6,0,0,1,1,1,1,2,2,2,2,
/*TCP-Header*/
0,0x66,0,0x66,0,0,0,0,0,0,0,0,0x50,0,0,1,0,0,0,0,
/*TPKT-Header RFC 1006*/
3,0,0,0
};
static zap_status_t openPcapFile(void)
{
@ -144,29 +166,6 @@ static zap_status_t writeQ931PacketToPcap(L3UCHAR* q931buf, L3USHORT q931size, L
spanid=span_id;
/*Predefined Ethernet Frame with Q931-over-IP encapsulated - From remote TDM host to FreeSWITCH*/
L3UCHAR recFrame[SNAPLEN]= {
/*IEEE 802.3 VLAN 802.1q Ethernet Frame Header*/
2,0,1,0xAA,0xAA,0xAA,2,0,1,0xBB,0xBB,0xBB,0x81,0,0xE0,0,0x08,0,
/*IPv4 Header (minimal size; no options)*/
0x45,0,0,44,0,0,0,0,64,6,0,0,2,2,2,2,1,1,1,1,
/*TCP-Header*/
0,0x66,0,0x66,0,0,0,0,0,0,0,0,0x50,0,0,1,0,0,0,0,
/*TPKT-Header RFC 1006*/
3,0,0,0
};
/*Predefined Ethernet Frame with Q931-over-IP encapsulated - Frome FreeSWITCH to remote TDM host*/
L3UCHAR sendFrame[SNAPLEN]= {
/*IEEE 802.3 VLAN 802.1q Ethernet Frame Header*/
2,0,1,0xBB,0xBB,0xBB,2,0,1,0xAA,0xAA,0xAA,0x81,0,0xE0,0,0x08,0,
/*IPv4 Header (minimal size; no options)*/
0x45,0,0,44,0,0,0,0,64,6,0,0,1,1,1,1,2,2,2,2,
/*TCP-Header*/
0,0x66,0,0x66,0,0,0,0,0,0,0,0,0x50,0,0,1,0,0,0,0,
/*TPKT-Header RFC 1006*/
3,0,0,0
};
/*The total length of the ethernet frame generated by this function has a min length of 66
so we don't have to care about padding :)*/