Sure, why not
This commit is contained in:
parent
4ea9f5f2dd
commit
4ce6d1e38e
1 changed files with 46 additions and 8 deletions
|
@ -11,6 +11,17 @@
|
|||
#include <patty/ax25/proto.h>
|
||||
#include <patty/ax25/frame.h>
|
||||
|
||||
#define PATTY_AX25_IF_OPT_TYPE_MASK 0x1f
|
||||
|
||||
enum patty_ax25_if_type {
|
||||
PATTY_AX25_IF_UNKNOWN = 0x00,
|
||||
PATTY_AX25_IF_KISS_TNC_TTY = 0x01,
|
||||
PATTY_AX25_IF_KISS_TNC_PORT = 0x02,
|
||||
PATTY_AX25_IF_KISS_TNC_I2C = 0x04,
|
||||
PATTY_AX25_IF_KISS_TNC_SPI = 0x08,
|
||||
PATTY_AX25_IF_SOFT_TNC = 0x10
|
||||
};
|
||||
|
||||
typedef struct _patty_ax25_stats {
|
||||
size_t frame_tx;
|
||||
size_t frame_rx;
|
||||
|
@ -19,21 +30,48 @@ typedef struct _patty_ax25_stats {
|
|||
|
||||
typedef struct _patty_ax25_address patty_ax25_port;
|
||||
|
||||
typedef struct _patty_ax25_if {
|
||||
patty_kiss_tnc * tnc;
|
||||
patty_ax25_stats stats;
|
||||
} patty_ax25_if;
|
||||
|
||||
typedef struct _patty_ax25_link {
|
||||
patty_ax25_port local;
|
||||
patty_ax25_port remote;
|
||||
patty_ax25_stats stats;
|
||||
} patty_ax25_link;
|
||||
|
||||
typedef struct _patty_ax25_if {
|
||||
patty_kiss_tnc * tnc;
|
||||
patty_ax25_stats stats;
|
||||
patty_dict * ports;
|
||||
|
||||
char name[8];
|
||||
} patty_ax25_if;
|
||||
|
||||
typedef struct _patty_ax25 {
|
||||
patty_dict * ax25_ifs;
|
||||
patty_dict * ports;
|
||||
patty_dict *
|
||||
patty_dict * ax25_ifs; /* Key: AX.25 interface name */
|
||||
patty_dict * ports; /* Key: Integer port descriptor */
|
||||
patty_dict * links; /* Key: Integer link descriptor */
|
||||
} patty_ax25;
|
||||
|
||||
void patty_ax25_init(patty_ax25 *ax25);
|
||||
|
||||
int patty_ax25_create_if(patty_ax25 *ax25, const char *name,
|
||||
int opts, void *info);
|
||||
|
||||
int patty_ax25_get_if(patty_ax25 *ax25, const char *name);
|
||||
|
||||
int patty_ax25_destroy_if(patty_ax25 *ax25, int iface);
|
||||
|
||||
int patty_ax25_listen(patty_ax25 *ax25, int iface,
|
||||
const char *callsign, int ssid);
|
||||
|
||||
int patty_ax25_shutdown(patty_ax25 *ax25, int port);
|
||||
|
||||
int patty_ax25_connect(patty_ax25 *ax25, int port,
|
||||
const char *callsign, int ssid);
|
||||
|
||||
int patty_ax25_close(patty_ax25 *ax25, int link);
|
||||
|
||||
int patty_ax25_recv(patty_ax25 *ax25, int iface, patty_ax25_frame *frame);
|
||||
|
||||
int patty_ax25_send(patty_ax25 *ax25, int iface,
|
||||
const patty_ax25_frame *frame);
|
||||
|
||||
#endif /* _PATTY_AX25_IF */
|
||||
|
|
Loading…
Add table
Reference in a new issue