diff --git a/include/patty/ax25.h b/include/patty/ax25.h index 41acf69..afdf89e 100644 --- a/include/patty/ax25.h +++ b/include/patty/ax25.h @@ -32,54 +32,7 @@ typedef struct _patty_ax25_if patty_ax25_if; #include #include #include - -enum patty_ax25_sock_status { - PATTY_AX25_SOCK_CLOSED, - PATTY_AX25_SOCK_LISTENING, - PATTY_AX25_SOCK_ESTABLISHED -}; - -enum patty_ax25_sock_mode { - PATTY_AX25_SOCK_DM, - PATTY_AX25_SOCK_SABM, - PATTY_AX25_SOCK_SABME -}; - -enum patty_ax25_sock_type { - PATTY_AX25_SOCK_NONE, - PATTY_AX25_SOCK_UNIX = 1 << 0, - PATTY_AX25_SOCK_PTY = 1 << 1, - PATTY_AX25_SOCK_RAW = 1 << 2, - PATTY_AX25_SOCK_NONBLOCK = 1 << 3 -}; - -typedef struct _patty_ax25_sock { - enum patty_ax25_sock_status status; - enum patty_ax25_sock_mode mode; - enum patty_ax25_sock_type type; - - time_t timer_ack, - timer_response, - timer_keepalive; - - unsigned int n_maxlen, - n_retry, - n_window; - - unsigned int seq_send, - seq_recv; - - int fd; - char path[PATTY_AX25_SOCK_PATH_SIZE]; - - patty_ax25_route *route; - - patty_ax25_addr local, - remote, - repeaters[PATTY_AX25_MAX_HOPS]; - - unsigned int hops; -} patty_ax25_sock; +#include int patty_ax25_pton(const char *callsign, uint8_t ssid, diff --git a/include/patty/ax25/sock.h b/include/patty/ax25/sock.h new file mode 100644 index 0000000..adf7794 --- /dev/null +++ b/include/patty/ax25/sock.h @@ -0,0 +1,52 @@ +#ifndef _PATTY_AX25_SOCK_H +#define _PATTY_AX25_SOCK_H + +enum patty_ax25_sock_status { + PATTY_AX25_SOCK_CLOSED, + PATTY_AX25_SOCK_LISTENING, + PATTY_AX25_SOCK_ESTABLISHED +}; + +enum patty_ax25_sock_mode { + PATTY_AX25_SOCK_DM, + PATTY_AX25_SOCK_SABM, + PATTY_AX25_SOCK_SABME +}; + +enum patty_ax25_sock_type { + PATTY_AX25_SOCK_NONE, + PATTY_AX25_SOCK_UNIX = 1 << 0, + PATTY_AX25_SOCK_PTY = 1 << 1, + PATTY_AX25_SOCK_RAW = 1 << 2, + PATTY_AX25_SOCK_NONBLOCK = 1 << 3 +}; + +typedef struct _patty_ax25_sock { + enum patty_ax25_sock_status status; + enum patty_ax25_sock_mode mode; + enum patty_ax25_sock_type type; + + time_t timer_ack, + timer_response, + timer_keepalive; + + unsigned int n_maxlen, + n_retry, + n_window; + + unsigned int seq_send, + seq_recv; + + int fd; + char path[PATTY_AX25_SOCK_PATH_SIZE]; + + patty_ax25_route *route; + + patty_ax25_addr local, + remote, + repeaters[PATTY_AX25_MAX_HOPS]; + + unsigned int hops; +} patty_ax25_sock; + +#endif /* _PATTY_AX25_SOCK_H */ diff --git a/src/Makefile b/src/Makefile index 77ce641..54c4d72 100644 --- a/src/Makefile +++ b/src/Makefile @@ -7,10 +7,12 @@ CC = $(CROSS)cc CFLAGS = $(CGFLAGS) -fPIC -Wall -O2 -I$(INCLUDE_PATH) LDFLAGS = -HEADERS = kiss.h ax25.h ax25/if.h ax25/macros.h ax25/proto.h ax25/call.h \ - ax25/frame.h ax25/server.h list.h hash.h dict.h +HEADERS = kiss.h ax25.h ax25/if.h ax25/macros.h ax25/proto.h \ + ax25/call.h ax25/frame.h ax25/sock.h ax25/server.h \ + list.h hash.h dict.h -OBJS = kiss.o ax25.o if.o call.o frame.o server.o list.o hash.o dict.o +OBJS = kiss.o ax25.o if.o call.o frame.o server.o \ + list.o hash.o dict.o EXAMPLES = decode ptmx