X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=secnet.h;h=cd2ea51e9212b96d1886d8ee158b052faf183a3b;hb=c905c1b3adda7adaf53acb44de4c9847cb19862c;hp=64a20a73a803e159317dcdae1944642deda3f17a;hpb=1bf7d7b80bd8af6385651d5ba7649a274c3885c2;p=secnet.git diff --git a/secnet.h b/secnet.h index 64a20a7..cd2ea51 100644 --- a/secnet.h +++ b/secnet.h @@ -3,6 +3,8 @@ #ifndef secnet_h #define secnet_h +#define ADNS_FEATURE_MANYAF + #include "config.h" #include #include @@ -17,6 +19,8 @@ #include #include +#include + #define MAX_PEER_ADDRS 5 /* send at most this many copies; honour at most that many addresses */ @@ -136,6 +140,14 @@ extern uint32_t dict_read_number(dict_t *dict, cstring_t key, bool_t required, /* return value can safely be assigned to int32_t */ extern bool_t dict_read_bool(dict_t *dict, cstring_t key, bool_t required, cstring_t desc, struct cloc loc, bool_t def); +const char **dict_read_string_array(dict_t *dict, cstring_t key, + bool_t required, cstring_t desc, + struct cloc loc, const char *const *def); + /* Return value is a NULL-terminated array obtained from malloc; + * Individual string values are still owned by config file machinery + * and must not be modified or freed. Returns NULL if key not + * found. */ + struct flagstr { cstring_t name; uint32_t value; @@ -293,7 +305,10 @@ struct buffer_if; will be freed once resolve_answer_fn returns. It is in network byte order. */ typedef void resolve_answer_fn(void *st, const struct comm_addr *addrs, - int naddrs); + int naddrs, const char *name, + const char *failwhy); + /* name is the same ptr as passed to request, so its lifetime must + * be suitable*/ typedef bool_t resolve_request_fn(void *st, cstring_t name, int remoteport, struct comm_if *comm, resolve_answer_fn *cb, void *cst); @@ -342,6 +357,7 @@ struct comm_addr { equivalent. */ struct comm_if *comm; union iaddr ia; + int ix; }; /* Return True if the packet was processed, and shouldn't be passed to