From 2f7988701fc09b14acedf3935864e7d369d236eb Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Fri, 17 Jul 2015 23:13:13 -0500 Subject: [PATCH] MACROS IN THE MORNING, MACROS IN THE EVENING, MACROS AT SUPPER TIME --- include/patty/ax25/macros.h | 3 +++ src/test.c | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/patty/ax25/macros.h b/include/patty/ax25/macros.h index 0336302..90d6c65 100644 --- a/include/patty/ax25/macros.h +++ b/include/patty/ax25/macros.h @@ -40,6 +40,9 @@ #define PATTY_AX25_CONTROL_UNNUMBERED_RESET(c) \ (c = 0x03) +#define PATTY_AX25_CONTROL_UNNUMBERED_MODIFIER(c) \ + ((c & 0xe0) >> 5) + #define PATTY_AX25_CONTROL_UNNUMBERED_SABM(c) \ (((c & 0xe0) == 0x10) && ((c & 0x0f) == 0x0f)) diff --git a/src/test.c b/src/test.c index 4b2fb5e..2c914fa 100644 --- a/src/test.c +++ b/src/test.c @@ -73,6 +73,16 @@ int main(int argc, char **argv) { } address_fprint(stderr, &frame); + + if (frame.type == PATTY_AX25_FRAME_INFO) { + fprintf(stderr, " ns %d", PATTY_AX25_CONTROL_SEQ_SEND(frame.control)); + fprintf(stderr, " nr %d", PATTY_AX25_CONTROL_SEQ_RECV(frame.control)); + } + + if (frame.payload) { + fprintf(stderr, " proto %02x", frame.proto); + } + fprintf(stderr, " %ld bytes\n", len); }