That's an interface!

This commit is contained in:
XANTRONIX Development 2015-07-24 18:16:05 -05:00 committed by XANTRONIX Industrial
parent 1ce32f18e3
commit 8bb8026851
3 changed files with 12 additions and 5 deletions

View file

@ -41,11 +41,11 @@ int patty_ax25_if_add_address(patty_ax25_if *iface,
int patty_ax25_if_delete_address(patty_ax25_if *iface,
const char *callsign, int ssid);
patty_ax25_if *patty_ax25_get_if(patty_ax25 *ax25, const char *name);
int patty_ax25_each_if(patty_ax25 *ax25,
int (*callback)(patty_ax25_if *, void *), void *ctx);
patty_ax25_if *patty_ax25_get_if(patty_ax25 *ax25, const char *name);
int patty_ax25_add_if(patty_ax25 *ax25, patty_ax25_if *iface);
int patty_ax25_delete_if(patty_ax25 *ax25, patty_ax25_if *iface);

View file

@ -4,11 +4,18 @@
typedef struct _patty_ax25_port {
enum patty_ax25_obj_type type;
patty_ax25_if *iface;
char callsign[7];
int ssid;
} patty_ax25_port;
patty_ax25_port *patty_ax25_listen(patty_ax25 *ax25, patty_ax25_if *iface,
patty_ax25_port *patty_ax25_port_create(patty_ax25_if *iface,
const char *callsign, int ssid);
void patty_ax25_port_destroy(patty_ax25_port *port);
int patty_ax25_each_port(patty_ax25 *ax25,
int (*callback)(patty_ax25_port *, void *), void *ctx);
#endif /* _PATTY_AX25_PORT_H */

View file

@ -7,14 +7,14 @@
#include <patty/kiss.h>
#include <patty/ax25.h>
typedef struct _patty_ax25 {
struct _patty_ax25 {
patty_list * ifaces;
patty_list * ports;
patty_list * links;
patty_dict * fd_lookup;
int fd;
} patty_ax25;
};
int patty_ax25_init(patty_ax25 *ax25) {
memset(ax25, '\0', sizeof(*ax25));