diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-02-13 12:52:04 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-02-13 12:52:04 +0100 |
commit | 60b67604f613245b5a9826f87534c12f8619404b (patch) | |
tree | 696ce5f2720b47d790d79a682c6216682a3447bd | |
parent | 4db1be4e7865cdd5b632d467819067c8dca942b1 (diff) |
racal2pcap: Correctly parse the TEI (to distinguish IXU from RRU)
-rwxr-xr-x | racal6113/racal2pcap.pl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/racal6113/racal2pcap.pl b/racal6113/racal2pcap.pl index 8be893d..a89bc13 100755 --- a/racal6113/racal2pcap.pl +++ b/racal6113/racal2pcap.pl @@ -51,9 +51,11 @@ sub hex2bin($) return pack('H*', $hexstring); } +my $tei; my $sapi; my $state = 0; my $msg_hex = ""; +my %ces_to_tei; while (my $line = <STDIN>) { chomp($line); @@ -69,7 +71,7 @@ while (my $line = <STDIN>) { $downlink = 1; } my $llh = make_linux_lapd_hdr($downlink); - my $lh = make_lapd_hdr($sapi, $sapi, $downlink); + my $lh = make_lapd_hdr($sapi, $tei, $downlink); my $msg = hex2bin($msg_hex); write_pcap_pkt($llh . $lh . $msg); @@ -78,7 +80,11 @@ while (my $line = <STDIN>) { } } if ($state == 0) { - if ($line =~ /^DL DATA INDICATION sapi = (\d+)/) { + if ($line =~ /^MDL_ASSIGN_REQUEST ces = (\d+),tei = (\d+)/) { + $ces_to_tei{$1} = $2; + } + if ($line =~ /^DL DATA INDICATION sapi = (\d+), ces = (\d+)/) { + $tei = $ces_to_tei{$2}; $sapi = $1; $state = 1; $msg_hex = ""; |