2015-07-24 22:28:39 +00:00
|
|
|
#ifndef _PATTY_AX25_IF_H
|
|
|
|
#define _PATTY_AX25_IF_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include <patty/list.h>
|
|
|
|
|
|
|
|
#define PATTY_AX25_IF_OPT_TYPE_MASK 0x1f
|
|
|
|
|
|
|
|
#define PATTY_AX25_IF_OPT_TYPE(n) \
|
|
|
|
((n) & PATTY_AX25_IF_OPT_TYPE_MASK)
|
|
|
|
|
|
|
|
enum patty_ax25_if_type {
|
2020-06-07 02:46:12 -04:00
|
|
|
PATTY_AX25_IF_UNKNOWN,
|
|
|
|
PATTY_AX25_IF_KISS_TNC,
|
|
|
|
PATTY_AX25_IF_HDLC
|
2015-07-24 22:28:39 +00:00
|
|
|
};
|
|
|
|
|
2020-05-27 22:03:42 -04:00
|
|
|
typedef struct _patty_ax25_if_stats {
|
|
|
|
size_t rx_frames,
|
|
|
|
tx_frames,
|
|
|
|
rx_bytes,
|
|
|
|
tx_bytes,
|
|
|
|
dropped;
|
|
|
|
} patty_ax25_if_stats;
|
|
|
|
|
2015-07-24 22:28:39 +00:00
|
|
|
typedef struct _patty_ax25_if {
|
2020-06-07 02:46:12 -04:00
|
|
|
enum patty_ax25_if_type type;
|
|
|
|
patty_ax25_if_stats stats;
|
2015-07-24 22:28:39 +00:00
|
|
|
|
2015-07-25 00:26:23 -05:00
|
|
|
char name[8];
|
|
|
|
|
2020-06-07 02:46:12 -04:00
|
|
|
patty_kiss_tnc *tnc;
|
|
|
|
patty_list *addrs;
|
2015-07-24 22:28:39 +00:00
|
|
|
} patty_ax25_if;
|
|
|
|
|
2015-07-24 21:34:11 -05:00
|
|
|
patty_ax25_if *patty_ax25_if_create(int opts, void *info);
|
2015-07-24 22:28:39 +00:00
|
|
|
|
|
|
|
void patty_ax25_if_destroy(patty_ax25_if *iface);
|
|
|
|
|
2020-06-07 02:46:12 -04:00
|
|
|
int patty_ax25_if_each_addr(patty_ax25_if *iface,
|
|
|
|
int (*callback)(char *, uint8_t, void *), void *ctx);
|
2015-07-24 22:28:39 +00:00
|
|
|
|
2020-06-07 02:46:12 -04:00
|
|
|
int patty_ax25_if_add_addr(patty_ax25_if *iface,
|
|
|
|
const char *callsign, uint8_t ssid);
|
2015-07-24 22:28:39 +00:00
|
|
|
|
2020-06-07 02:46:12 -04:00
|
|
|
int patty_ax25_if_delete_addr(patty_ax25_if *iface,
|
|
|
|
const char *callsign, uint8_t ssid);
|
2015-07-24 22:28:39 +00:00
|
|
|
|
2020-06-16 01:59:47 -04:00
|
|
|
patty_ax25_if *patty_ax25_get_if(patty_ax25_server *server,
|
|
|
|
const char *name);
|
2015-07-24 18:16:05 -05:00
|
|
|
|
2020-06-16 01:59:47 -04:00
|
|
|
int patty_ax25_if_each(patty_ax25_server *server,
|
|
|
|
int (*callback)(patty_ax25_if *, void *),
|
|
|
|
void *ctx);
|
2015-07-24 22:28:39 +00:00
|
|
|
|
2020-06-16 01:59:47 -04:00
|
|
|
int patty_ax25_add_if(patty_ax25_server *server,
|
|
|
|
patty_ax25_if *iface);
|
2015-07-24 22:28:39 +00:00
|
|
|
|
2020-06-16 01:59:47 -04:00
|
|
|
int patty_ax25_delete_if(patty_ax25_server *server,
|
|
|
|
patty_ax25_if *iface);
|
2015-07-24 22:28:39 +00:00
|
|
|
|
|
|
|
#endif /* _PATTY_AX25_IF_H */
|