Split patty_ax25_sock into patty/ax25/sock.h
This commit is contained in:
parent
ac8b239ed8
commit
5607dbede6
3 changed files with 58 additions and 51 deletions
|
@ -32,54 +32,7 @@ typedef struct _patty_ax25_if patty_ax25_if;
|
||||||
#include <patty/ax25/call.h>
|
#include <patty/ax25/call.h>
|
||||||
#include <patty/ax25/if.h>
|
#include <patty/ax25/if.h>
|
||||||
#include <patty/ax25/route.h>
|
#include <patty/ax25/route.h>
|
||||||
|
#include <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;
|
|
||||||
|
|
||||||
int patty_ax25_pton(const char *callsign,
|
int patty_ax25_pton(const char *callsign,
|
||||||
uint8_t ssid,
|
uint8_t ssid,
|
||||||
|
|
52
include/patty/ax25/sock.h
Normal file
52
include/patty/ax25/sock.h
Normal file
|
@ -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 */
|
|
@ -7,10 +7,12 @@ CC = $(CROSS)cc
|
||||||
CFLAGS = $(CGFLAGS) -fPIC -Wall -O2 -I$(INCLUDE_PATH)
|
CFLAGS = $(CGFLAGS) -fPIC -Wall -O2 -I$(INCLUDE_PATH)
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
HEADERS = kiss.h ax25.h ax25/if.h ax25/macros.h ax25/proto.h ax25/call.h \
|
HEADERS = kiss.h ax25.h ax25/if.h ax25/macros.h ax25/proto.h \
|
||||||
ax25/frame.h ax25/server.h list.h hash.h dict.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
|
EXAMPLES = decode ptmx
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue