summaryrefslogtreecommitdiff
path: root/gsmstack/source_pcap_burst.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2008-12-01 12:54:30 +0530
committerHarald Welte <laforge@gnumonks.org>2008-12-01 12:54:30 +0530
commit602a3c8aa8a3d9bd4d93deda6ac932404f39584d (patch)
treea8c44956098cc4a6151fd9d8e0d8afc035182159 /gsmstack/source_pcap_burst.c
parent10f2fcca8dd1be2719bccefa16fd9dac9a76c749 (diff)
Add README, various compile fixes
Diffstat (limited to 'gsmstack/source_pcap_burst.c')
-rw-r--r--gsmstack/source_pcap_burst.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gsmstack/source_pcap_burst.c b/gsmstack/source_pcap_burst.c
index bb340e7..0956c19 100644
--- a/gsmstack/source_pcap_burst.c
+++ b/gsmstack/source_pcap_burst.c
@@ -1,6 +1,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+
#include <pcap.h>
#include "gsmstack.h"
@@ -16,7 +19,7 @@
*/
-static struct gsm_rf_chan rfchans[NR_ARFCN];
+static struct gsm_rf_chan *rfchans[NR_ARFCN];
static int read_pcap_hdr(int fd)
{
@@ -59,7 +62,7 @@ static int send_burst(struct gsmtap_hdr *gh, int burst_len,
}
rfchan = rfchans[arfcn];
- pchan = rfchan->phys_chan[gh->timeslot];
+ pchan = &rfchan->phys_chan[gh->timeslot];
memset(&burst, 0, sizeof(burst));
burst.phys_chan = pchan;
@@ -95,11 +98,11 @@ static int read_one_pkt(int fd, unsigned char *buf, int bufsize,
return -4;
if (tv) {
- tv.tv_sec = pkthdr.tv_sec;
- tv.tv_usec = pkthdr.tv_usec;
+ tv->tv_sec = pkthdr.ts.tv_sec;
+ tv->tv_usec = pkthdr.ts.tv_usec;
}
- len = read(fd, buf, pkthdr.caplen)
+ len = read(fd, buf, pkthdr.caplen);
if (len < pkthdr.caplen)
return -5;
@@ -138,7 +141,7 @@ int main(int argc, char **argv)
unsigned char buf[1024];
struct timeval tv;
int burst_len;
- burst_len = read_one_pkt(fd, &tv, sbuf, sizeof(buf));
+ burst_len = read_one_pkt(fd, buf, sizeof(buf), &tv);
if (burst_len < 0) {
fprintf(stderr, "read_one_pkt() = %d\n", burst_len);
exit(3);
personal git repositories of Harald Welte. Your mileage may vary