X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/2d7478f775f7e150f46f095e8e4db90f24b362b8..9c44ef13ed639445ee2e8a4037f7b3c5fcc11aa2:/comm-common.h diff --git a/comm-common.h b/comm-common.h index 13709c7..5087ad9 100644 --- a/comm-common.h +++ b/comm-common.h @@ -89,7 +89,12 @@ struct udpcommon { bool_t udp_make_socket(struct udpcommon *uc, struct udpsock *us, int failmsgclass); - /* Fills in us->fd. Logs any errors with lg_[v]perror. */ + /* Caller should have filled in ->addr. Fills in us->fd, + ->experienced; updates ->addr. Logs any errors with lg_[v]perror. */ +bool_t udp_import_socket(struct udpcommon *uc, struct udpsock *us, + int failmsgclass, int fd); + /* Like udp_make_socket, but caller provides fd. fd is not closed + on error */ void udp_destroy_socket(struct udpcommon *uc, struct udpsock *us); /* Idempotent. No errors are possible. */ @@ -102,11 +107,12 @@ void udp_sock_experienced(struct log_if *lg, struct udpcommon *uc, void udp_socks_register(struct udpcommon *uc, struct udpsocks *socks); void udp_socks_deregister(struct udpcommon *uc, struct udpsocks *socks); +void udp_socks_childpersist(struct udpcommon *uc, struct udpsocks *socks); #define UDP_APPLY_STANDARD(st,uc,desc) \ (uc)->use_proxy=False; \ (uc)->authbind=dict_read_string(d,"authbind",False,"udp",(uc)->cc.loc); \ - (uc)->port=dict_read_number(d,"port",True,"udp",(uc)->cc.loc,0) + (uc)->port=dict_read_number(d,"port",False,"udp",(uc)->cc.loc,0) /* void UDP_APPLY_STANDARD(SOMETHING *st, struct udpcommon *uc, * const char *desc); * // Expects in scope: dict_t *d=...; as from COMM_APPLY_STANDARD