cleanup: Replace a few calls to malloc/realloc with safe_malloc
[secnet] / comm-common.h
index 44bb6c3..baeb24e 100644 (file)
@@ -72,6 +72,7 @@ struct udpsocks {
     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 {
@@ -82,8 +83,15 @@ struct udpcommon {
     union iaddr proxy;
 };
 
-void udp_make_socket(struct udpcommon *uc, struct udpsock *us);
+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_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;                                             \