# HG changeset patch # User Mychaela Falconia # Date 1726711154 0 # Node ID 96b37cef502020eaca72772508228b551eda0531 # Parent e7f43262efa1ad2e50201d609c9dca7f87290623 rtp-gsmfr-dump: convert from old libgsm to libgsmfr2 diff -r e7f43262efa1 -r 96b37cef5020 pcap-study/Makefile --- a/pcap-study/Makefile Sun Jul 28 01:53:41 2024 +0000 +++ b/pcap-study/Makefile Thu Sep 19 01:59:14 2024 +0000 @@ -12,7 +12,7 @@ ${CC} ${CFLAGS} -o $@ $@.c -lpcap rtp-gsmfr-dump: rtp-gsmfr-dump.c - ${CC} ${CFLAGS} -o $@ $@.c -lpcap -lgsmefr -lgsm + ${CC} ${CFLAGS} -o $@ $@.c -lpcap -lgsmefr -lgsmfr2 rtp-gsmfr-extr: rtp-gsmfr-extr.c ${CC} ${CFLAGS} -o $@ $@.c -lpcap diff -r e7f43262efa1 -r 96b37cef5020 pcap-study/rtp-gsmfr-dump.c --- a/pcap-study/rtp-gsmfr-dump.c Sun Jul 28 01:53:41 2024 +0000 +++ b/pcap-study/rtp-gsmfr-dump.c Thu Sep 19 01:59:14 2024 +0000 @@ -16,11 +16,12 @@ #include #include #include +#include #include #include #include #include -#include +#include #include static pcap_t *pcap; @@ -30,7 +31,6 @@ static unsigned link_hdr_len, ethertype_offset; static int stream_init_flag; static unsigned last_seq, last_tstamp, stream_ssrc; -static gsm dummy_state; static void check_dl_type() @@ -96,7 +96,7 @@ u_char *payload; unsigned payload_len; { - gsm_signal params[76]; + int16_t params[76]; int i, j, n; printf("seq 0x%04X ts 0x%08X: ", last_seq, last_tstamp); @@ -144,7 +144,7 @@ if ((payload[0] & 0xF0) != 0xD0) break; fputs("std FR", stdout); - gsm_explode(dummy_state, payload, params); + gsmfr_unpack_to_array(payload, params); print_fr: n = 0; for (i = 0; i < 8; i++) @@ -163,7 +163,7 @@ if ((payload[1] & 0xF0) != 0xD0) break; printf("TEH 0x%02X FR", payload[0]); - gsm_explode(dummy_state, payload+1, params); + gsmfr_unpack_to_array(payload+1, params); goto print_fr; } printf("unknown payload format, length=%u\n", payload_len); @@ -257,11 +257,6 @@ exit(1); } match_udp_port = htons(strtoul(argv[4], 0, 0)); - dummy_state = gsm_create(); - if (!dummy_state) { - fprintf(stderr, "gsm_create() failed!\n"); - exit(1); - } for (pkt_idx = 0; ; pkt_idx++) { pkt = pcap_next(pcap, &pkthdr); if (!pkt)