chiark / gitweb /
comm: Make udp_make_socket be able to tolerate failures
[secnet.git] / comm-common.h
index ba49254f47493dc48b75de30b91c226d48120443..835d056b5d5117e8e0f99a6ee02c165bc06ee2dc 100644 (file)
@@ -70,6 +70,8 @@ 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 udpcommon {
@@ -80,12 +82,11 @@ 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_socks_register(struct udpcommon *uc, struct udpsocks *socks);
 
 #define UDP_APPLY_STANDARD(st,uc,desc)                                 \
     (uc)->use_proxy=False;                                             \