X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/763e458ff3a1cb4f9d11226db91f17069f7b8f7a..5e7a5e2d42c1b06f249debca72c10ad33d157402:/comm-common.h diff --git a/comm-common.h b/comm-common.h index ba49254..baeb24e 100644 --- a/comm-common.h +++ b/comm-common.h @@ -70,6 +70,9 @@ struct udpsock { struct udpsocks { int n_socks; struct udpsock socks[UDP_MAX_SOCKETS]; + /* private for udp_socks_* */ + struct udpcommon *uc; /* link to parent, for cfg, notify list, etc. */ + struct poll_interest *interest; }; struct udpcommon { @@ -80,12 +83,15 @@ struct udpcommon { union iaddr proxy; }; -int udp_socks_beforepoll(struct udpsocks *s, - struct pollfd *fds, int *nfds_io, - int *timeout_io); +bool_t udp_make_socket(struct udpcommon *uc, struct udpsock *us, + int failmsgclass); + /* Fills in us->fd. Logs any errors with lg_[v]perror. */ -void udp_socks_afterpoll(struct udpcommon *u, struct udpsocks *s, - struct pollfd *fds, int nfds); +void udp_destroy_socket(struct udpcommon *uc, struct udpsock *us); + /* Idempotent. No errors are possible. */ + +void udp_socks_register(struct udpcommon *uc, struct udpsocks *socks); +void udp_socks_deregister(struct udpcommon *uc, struct udpsocks *socks); #define UDP_APPLY_STANDARD(st,uc,desc) \ (uc)->use_proxy=False; \