Stub out patty_ax25_next_event()
This commit is contained in:
parent
71d43b5f11
commit
ff76e77336
6 changed files with 59 additions and 2 deletions
|
@ -85,8 +85,8 @@ int patty_ax25_accept(patty_ax25 *ax25,
|
||||||
|
|
||||||
int patty_ax25_close(patty_ax25 *ax25, int fd);
|
int patty_ax25_close(patty_ax25 *ax25, int fd);
|
||||||
|
|
||||||
int patty_ax25_wait(patty_ax25 *ax25,
|
int patty_ax25_next_event(patty_ax25 *ax25,
|
||||||
int fds, enum patty_ax25_event *ev);
|
enum patty_ax25_event *ev);
|
||||||
|
|
||||||
int patty_ax25_recv(patty_ax25 *ax25,
|
int patty_ax25_recv(patty_ax25 *ax25,
|
||||||
int fd, patty_ax25_frame *frame);
|
int fd, patty_ax25_frame *frame);
|
||||||
|
|
|
@ -34,6 +34,8 @@ patty_ax25_if *patty_ax25_if_create(int opts, void *info);
|
||||||
|
|
||||||
void patty_ax25_if_destroy(patty_ax25_if *iface);
|
void patty_ax25_if_destroy(patty_ax25_if *iface);
|
||||||
|
|
||||||
|
patty_kiss_tnc *patty_ax25_if_tnc(patty_ax25_if *iface);
|
||||||
|
|
||||||
int patty_ax25_if_each_address(patty_ax25_if *iface,
|
int patty_ax25_if_each_address(patty_ax25_if *iface,
|
||||||
int (*callback)(patty_ax25_address *, void *), void *ctx);
|
int (*callback)(patty_ax25_address *, void *), void *ctx);
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ typedef struct _patty_kiss_tnc patty_kiss_tnc;
|
||||||
|
|
||||||
patty_kiss_tnc *patty_kiss_tnc_open(const char *device, size_t bufsize);
|
patty_kiss_tnc *patty_kiss_tnc_open(const char *device, size_t bufsize);
|
||||||
|
|
||||||
|
int patty_kiss_tnc_fd_unix(patty_kiss_tnc *tnc);
|
||||||
|
|
||||||
void patty_kiss_tnc_close(patty_kiss_tnc *tnc);
|
void patty_kiss_tnc_close(patty_kiss_tnc *tnc);
|
||||||
|
|
||||||
int patty_kiss_tnc_dropped(patty_kiss_tnc *tnc);
|
int patty_kiss_tnc_dropped(patty_kiss_tnc *tnc);
|
||||||
|
|
45
src/ax25.c
45
src/ax25.c
|
@ -187,3 +187,48 @@ error_exists:
|
||||||
error_fd_lookup:
|
error_fd_lookup:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int event_fd_set(patty_ax25 *ax25, fd_set *set) {
|
||||||
|
patty_list_iterator *ifaces;
|
||||||
|
patty_ax25_if *iface;
|
||||||
|
|
||||||
|
FD_ZERO(set);
|
||||||
|
|
||||||
|
if ((ifaces = patty_list_start(ax25->ifaces)) == NULL) {
|
||||||
|
goto error_list_start;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ((iface = patty_list_next(ifaces)) != NULL) {
|
||||||
|
patty_kiss_tnc *tnc;
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
if ((tnc = patty_ax25_if_tnc(iface)) == NULL) {
|
||||||
|
goto error_if_tnc;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((fd = patty_kiss_tnc_fd_unix(tnc)) < 0) {
|
||||||
|
goto error_kiss_tnc_fd_unix;
|
||||||
|
}
|
||||||
|
|
||||||
|
FD_SET(fd, set);
|
||||||
|
}
|
||||||
|
|
||||||
|
patty_list_finish(ifaces);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
error_kiss_tnc_fd_unix:
|
||||||
|
error_if_tnc:
|
||||||
|
patty_list_finish(ifaces);
|
||||||
|
|
||||||
|
error_list_start:
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int patty_ax25_next_event(patty_ax25 *ax25, enum patty_ax25_event *ev) {
|
||||||
|
fd_set fds;
|
||||||
|
|
||||||
|
event_fd_set(ax25, &fds);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
4
src/if.c
4
src/if.c
|
@ -79,6 +79,10 @@ void patty_ax25_if_destroy(patty_ax25_if *iface) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
patty_kiss_tnc *patty_ax25_if_tnc(patty_ax25_if *iface) {
|
||||||
|
return iface->tnc;
|
||||||
|
}
|
||||||
|
|
||||||
int patty_ax25_if_each_address(patty_ax25_if *iface, int (*callback)(patty_ax25_address *, void *), void *ctx) {
|
int patty_ax25_if_each_address(patty_ax25_if *iface, int (*callback)(patty_ax25_address *, void *), void *ctx) {
|
||||||
patty_list_iterator *iter;
|
patty_list_iterator *iter;
|
||||||
patty_ax25_address *address;
|
patty_ax25_address *address;
|
||||||
|
|
|
@ -65,6 +65,10 @@ error_malloc_tnc:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int patty_kiss_tnc_fd_unix(patty_kiss_tnc *tnc) {
|
||||||
|
return tnc->fd;
|
||||||
|
}
|
||||||
|
|
||||||
void patty_kiss_tnc_close(patty_kiss_tnc *tnc) {
|
void patty_kiss_tnc_close(patty_kiss_tnc *tnc) {
|
||||||
close(tnc->fd);
|
close(tnc->fd);
|
||||||
free(tnc->frame);
|
free(tnc->frame);
|
||||||
|
|
Loading…
Add table
Reference in a new issue