From dafde94bfe12c9c22697f769cce2bb23023a0a41 Mon Sep 17 00:00:00 2001 From: luckyhacky Date: Thu, 13 Nov 2014 20:35:39 +0100 Subject: [PATCH] fixed warnings from compiler findings - added missing header definition for tun_alloc - added missing switch cases -> fixed by TODO/FIXME comment --- src/conv_enc_test.c | 5 ++++- src/lower_mac/tetra_conv_enc.c | 2 ++ src/phy/tetra_burst.c | 8 ++++++++ src/tetra_llc.c | 15 ++++++++++++++- src/tuntap.h | 8 ++++++++ 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/tuntap.h diff --git a/src/conv_enc_test.c b/src/conv_enc_test.c index 303ef31..149c7e7 100644 --- a/src/conv_enc_test.c +++ b/src/conv_enc_test.c @@ -306,8 +306,11 @@ int build_sb() int main(int argc, char **argv) { - int err, i; + int i; +#if 0 + int err; uint16_t out; +#endif uint32_t ret; /* first: run some subsystem tests */ diff --git a/src/lower_mac/tetra_conv_enc.c b/src/lower_mac/tetra_conv_enc.c index c3c3cac..95b4ebf 100644 --- a/src/lower_mac/tetra_conv_enc.c +++ b/src/lower_mac/tetra_conv_enc.c @@ -31,6 +31,7 @@ #include #include +#if 0 static char *dump_state(struct conv_enc_state *ces) { static char pbuf[1024]; @@ -38,6 +39,7 @@ static char *dump_state(struct conv_enc_state *ces) ces->delayed[1], ces->delayed[2], ces->delayed[3]); return pbuf; } +#endif /* Mother code according to Section 8.2.3.1.1 */ static uint8_t conv_enc_in_bit(struct conv_enc_state *ces, uint8_t bit, uint8_t *out) diff --git a/src/phy/tetra_burst.c b/src/phy/tetra_burst.c index 62efb72..e505740 100644 --- a/src/phy/tetra_burst.c +++ b/src/phy/tetra_burst.c @@ -314,6 +314,10 @@ void tetra_burst_rx_cb(const uint8_t *burst, unsigned int len, enum tetra_train_ uint8_t ndbf_buf[2*NDB_BLK_BITS]; switch (type) { + case TETRA_TRAIN_EXT: + // TODO: currently not handled! + // FIXME + break; case TETRA_TRAIN_SYNC: /* Split SB1, SB2 and Broadcast Block */ /* send three parts of the burst via TP-SAP into lower MAC */ @@ -321,6 +325,10 @@ void tetra_burst_rx_cb(const uint8_t *burst, unsigned int len, enum tetra_train_ tp_sap_udata_ind(TPSAP_T_BBK, burst+SB_BBK_OFFSET, SB_BBK_BITS, priv); tp_sap_udata_ind(TPSAP_T_SB2, burst+SB_BLK2_OFFSET, SB_BLK2_BITS, priv); break; + case TETRA_TRAIN_NORM_3: + // TODO: currently not handled! + // FIXME + break; case TETRA_TRAIN_NORM_2: /* re-combine the broadcast block */ memcpy(bbk_buf, burst+NDB_BBK1_OFFSET, NDB_BBK1_BITS); diff --git a/src/tetra_llc.c b/src/tetra_llc.c index 432f5a7..9397bcb 100644 --- a/src/tetra_llc.c +++ b/src/tetra_llc.c @@ -28,6 +28,7 @@ #include #include "tetra_llc_pdu.h" +#include "tuntap.h" static int tun_fd = -1; @@ -78,7 +79,7 @@ static int tllc_defrag_in(struct tllc_state *llcs, return 0; } -static int tllc_defrag_out(struct tllc_state *llcs, +static void tllc_defrag_out(struct tllc_state *llcs, struct tetra_llc_pdu *lpp) { struct tllc_defrag_q_e *dqe; @@ -147,6 +148,18 @@ int rx_tm_sdu(struct msgb *msg, unsigned int len) /* check if the fragment is complete and hand it off*/ tllc_defrag_out(&g_llcs, &lpp); break; + case TLLC_PDUT_DEC_UNKNOWN: + // TODO: currently not handled! + // FIXME + break; + case TLLC_PDUT_DEC_ALX_ACK: + // TODO: currently not handled! + // FIXME + break; + case TLLC_PDUT_DEC_ALX_RNR: + // TODO: currently not handled! + // FIXME + break; } if (lpp.tl_sdu && lpp.ss == 0) { diff --git a/src/tuntap.h b/src/tuntap.h new file mode 100644 index 0000000..6f82d69 --- /dev/null +++ b/src/tuntap.h @@ -0,0 +1,8 @@ +#ifndef TUNTAP_H +#define TUNTAP_H + +/* Allocate a tun interface */ +int tun_alloc(char *dev); + + +#endif /* TUNTAP_H */