X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=secnet.git;a=blobdiff_plain;f=comm-common.h;h=4aa644a47e46102a28202bc5bca138219e891a08;hp=5087ad9eb9e690010ef6f6b52bab01b464470373;hb=94ca562bb14422940ff1986ce8dfca87c222cb59;hpb=9c44ef13ed639445ee2e8a4037f7b3c5fcc11aa2 diff --git a/comm-common.h b/comm-common.h index 5087ad9..4aa644a 100644 --- a/comm-common.h +++ b/comm-common.h @@ -34,7 +34,7 @@ bool_t comm_notify(struct comm_notify_list *notify, struct buffer_if *buf, void comm_apply(struct commcommon *cc, void *st); #define COMM_APPLY(st,cc,prefix,desc,loc) \ - (st)=safe_malloc(sizeof(*(st)), desc "_apply"); \ + NEW(st); \ (cc)->loc=loc; \ (cc)->cl.description=desc; \ (cc)->ops.sendmsg=prefix##sendmsg; \ @@ -77,6 +77,7 @@ struct udpsocks { /* private for udp_socks_* */ struct udpcommon *uc; /* link to parent, for cfg, notify list, etc. */ struct poll_interest *interest; + const char *desc; }; struct udpcommon { @@ -101,11 +102,12 @@ void udp_destroy_socket(struct udpcommon *uc, struct udpsock *us); const char *af_name(int af); void udp_sock_experienced(struct log_if *lg, struct udpcommon *uc, - const char *socksdesc, struct udpsock *us, - bool_t recvsend, int af /* 0 means any */, + struct udpsocks *socks, struct udpsock *us, + const union iaddr *dest, int af /* 0 means any */, int r, int errnoval); -void udp_socks_register(struct udpcommon *uc, struct udpsocks *socks); +void udp_socks_register(struct udpcommon *uc, struct udpsocks *socks, + const char *desc); void udp_socks_deregister(struct udpcommon *uc, struct udpsocks *socks); void udp_socks_childpersist(struct udpcommon *uc, struct udpsocks *socks);