E1 INPUT: Fix PCAP file generation for non-mISDN case

This commit is contained in:
Harald Welte 2011-02-12 14:00:23 +01:00
parent f27d043032
commit 95aa5c4ae3
1 changed files with 5 additions and 9 deletions

View File

@ -143,7 +143,6 @@ static void write_pcap_packet(int direction, int sapi, int tei,
int ret;
time_t cur_time;
struct tm *tm;
int mi_head = (direction==PCAP_INPUT) ? MISDN_HEADER_LEN : 0;
struct fake_linux_lapd_header header = {
.pkttype = 4,
@ -165,12 +164,10 @@ static void write_pcap_packet(int direction, int sapi, int tei,
struct pcaprec_hdr payload_header = {
.ts_sec = 0,
.ts_usec = 0,
.incl_len = msg->len + sizeof(struct fake_linux_lapd_header)
+ sizeof(struct lapd_header)
- mi_head,
.orig_len = msg->len + sizeof(struct fake_linux_lapd_header)
+ sizeof(struct lapd_header)
- mi_head,
.incl_len = msgb_l2len(msg) + sizeof(struct fake_linux_lapd_header)
+ sizeof(struct lapd_header),
.orig_len = msgb_l2len(msg) + sizeof(struct fake_linux_lapd_header)
+ sizeof(struct lapd_header),
};
@ -181,8 +178,7 @@ static void write_pcap_packet(int direction, int sapi, int tei,
ret = write(pcap_fd, &payload_header, sizeof(payload_header));
ret = write(pcap_fd, &header, sizeof(header));
ret = write(pcap_fd, &lapd_header, sizeof(lapd_header));
ret = write(pcap_fd, msg->data + mi_head,
msg->len - mi_head);
ret = write(pcap_fd, msg->l2h, msgb_l2len(msg));
}
static const char *sign_types[] = {