chiark / gitweb /
src/setup.c, src/transmit.c: New function finds udpsocket by AF.
[adns] / src / internal.h
index b602c92aeb2858f5d3be5867a50db4c31cea6032..bc5f542bb132f7b71ba9213959c561527f008a6e 100644 (file)
@@ -130,7 +130,11 @@ union gen_addr {
 };
 
 union checklabel_state {
-  int dummy;
+  struct {
+#define PTR_NDOMAIN 2
+    unsigned domainmap;                        /* which domains are still live */
+    byte ipv[PTR_NDOMAIN][32];         /* address components so far */
+  } ptr;
 };
 
 typedef struct {
@@ -159,11 +163,13 @@ typedef struct {
   void (*callback)(adns_query parent, adns_query child);
 
   union {
-    struct afinfo_addr ptr_parent_addr;
     adns_rr_hostaddr *hostaddr;
   } pinfo; /* state for use by parent's callback function */
 
   union {
+    struct {
+      struct afinfo_addr addr;
+    } ptr;
     struct {
       unsigned want, have;
     } addr;
@@ -495,6 +501,15 @@ void adns__querysend_tcp(adns_query qu, struct timeval now);
  * might be broken, but no reconnect will be attempted.
  */
 
+struct udpsocket *adns__udpsocket_by_af(adns_state ads, int af);
+/* Find the UDP socket structure in ads which has the given address family.
+ * Return null if there isn't one.
+ *
+ * This is used during initialization, so ads is only partially filled in.
+ * The requirements are that nudp is set, and that udpsocket[i].af are
+ * defined for 0<=i<nudp.
+ */
+
 void adns__query_send(adns_query qu, struct timeval now);
 /* Query must be in state tosend/NONE; it will be moved to a new state,
  * and no further processing can be done on it for now.