From 118a87c255109443b9cc39668122118e65fc1ccf Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Thu, 2 Jul 2015 23:40:37 -0500 Subject: [PATCH] Xan needs a break --- include/patty/ax25.h | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/include/patty/ax25.h b/include/patty/ax25.h index 8b92826..aaa8408 100644 --- a/include/patty/ax25.h +++ b/include/patty/ax25.h @@ -26,13 +26,44 @@ typedef struct _patty_ax25_address { unsigned int repeated :1; } patty_ax25_address; -typedef struct _patty_ax25_control { - unsigned int control :1; +#define PATTY_AX25_CONTROL_INFO(c) \ + ((c & 0x01) == 0) - union { - - }; -} patty_ax25_control; +#define PATTY_AX25_CONTROL_SUPER(c) \ + ((c & 0x03) == 0x01) + +#define PATTY_AX25_CONTROL_UNNUMBERED(c) \ + ((c & 0x03) == 0x03) + +#define PATTY_AX25_CONTROL_SEQ_SEND(c) \ + ((c & 0x0e) >> 1) + +#define PATTY_AX25_CONTROL_SEQ_RECV(c) \ + ((c & 0xe0) >> 5) + +#define PATTY_AX25_CONTROL_POLL(c) \ + ((c & 0x10) >> 4) + +typedef struct _patty_ax25_control_info { + unsigned int control :1; + unsigned int seq_send :3; + unsigned int poll :1; + unsigned int seq_recv :3; +} patty_ax25_control_info; + +typedef struct _patty_ax25_control_super { + unsigned int control :2; + unsigned int function :2; + unsigned int poll :1; + unsigned int seq_recv :3; +} patty_ax25_control_super; + +typedef struct _patty_ax25_control_unnumbered { + unsigned int control :2; + unsigned int modifier :2; + unsigned int poll :1; + unsigned int modifier2 :3; +} patty_ax25_control_unnumbered; typedef struct _patty_ax25_packet { patty_ax25_address dest;