X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=secnet.h;h=7d1edb0737d6709714973f9b438a66bddd5a08c5;hb=0902e6e2feabad072f0b5d7f23ae2a2a4d923d0a;hp=78dc676f4eb72f3180c03601e98917c8b79b6d9f;hpb=a094a1bae5bcadfb96a57a3d31c1aa7c8815631d;p=secnet.git diff --git a/secnet.h b/secnet.h index 78dc676..7d1edb0 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 @@ -136,6 +138,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; @@ -295,7 +305,10 @@ struct buffer_if; actually found in the DNS, which may be bigger if addrs is equal to MAX_PEER_ADDRS (ie there were too many). */ typedef void resolve_answer_fn(void *st, const struct comm_addr *addrs, - int naddrs, int was_naddrs); + int naddrs, int was_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); @@ -339,6 +352,7 @@ struct comm_addr { freely copy it. */ struct comm_if *comm; union iaddr ia; + int ix; /* see comment `Re comm_addr.ix' in udp.c */ }; /* Return True if the packet was processed, and shouldn't be passed to @@ -574,6 +588,7 @@ extern void log_from_fd(int fd, cstring_t prefix, struct log_if *log); #define STRING(x) STRING2(x) #define FILLZERO(obj) (memset(&(obj),0,sizeof((obj)))) +#define ARRAY_SIZE(ary) (sizeof((ary))/sizeof((ary)[0])) /* * void COPY_OBJ( OBJECT& dst, const OBJECT& src);