X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/4b2c4f8a37e33604c1aeddafe49b7c33089692a4..51cc4d904a18367cc69960bf20f0398725ece443:/client/adh-query.c?ds=sidebyside diff --git a/client/adh-query.c b/client/adh-query.c index cc5dc12..856b6b2 100644 --- a/client/adh-query.c +++ b/client/adh-query.c @@ -5,10 +5,10 @@ */ /* * This file is - * Copyright (C) 1997-1999 Ian Jackson + * Copyright (C) 1997-2000 Ian Jackson * * It is part of adns, which is - * Copyright (C) 1997-1999 Ian Jackson + * Copyright (C) 1997-2000 Ian Jackson * Copyright (C) 1999 Tony Finch * * This program is free software; you can redistribute it and/or modify @@ -79,7 +79,7 @@ static void prep_query(struct query_node **qun_r, int *quflags_r) { *qun_r= qun; } -void of_ptr(const struct optioninfo *oi, const char *arg) { +void of_ptr(const struct optioninfo *oi, const char *arg, const char *arg2) { struct query_node *qun; int quflags, r; struct sockaddr_in sa; @@ -101,6 +101,29 @@ void of_ptr(const struct optioninfo *oi, const char *arg) { LIST_LINK_TAIL(outstanding,qun); } +void of_reverse(const struct optioninfo *oi, const char *arg, const char *arg2) { + struct query_node *qun; + int quflags, r; + struct sockaddr_in sa; + + memset(&sa,0,sizeof(sa)); + sa.sin_family= AF_INET; + if (!inet_aton(arg,&sa.sin_addr)) usageerr("invalid IP address %s",arg); + + prep_query(&qun,&quflags); + qun->owner= xmalloc(strlen(arg) + strlen(arg2) + 2); + sprintf(qun->owner, "%s %s", arg,arg2); + r= adns_submit_reverse_any(ads, + (struct sockaddr*)&sa, arg2, + ov_type == adns_r_none ? adns_r_txt : ov_type, + quflags, + qun, + &qun->qu); + if (r) sysfail("adns_submit_reverse",r); + + LIST_LINK_TAIL(outstanding,qun); +} + void query_do(const char *domain) { struct query_node *qun; int quflags, r; @@ -263,12 +286,12 @@ void query_done(struct query_node *qun, adns_answer *answer) { dequeue_query(qun); } -void of_asynch_id(const struct optioninfo *oi, const char *arg) { +void of_asynch_id(const struct optioninfo *oi, const char *arg, const char *arg2) { free(ov_id); ov_id= xstrsave(arg); } -void of_cancel_id(const struct optioninfo *oi, const char *arg) { +void of_cancel_id(const struct optioninfo *oi, const char *arg, const char *arg2) { struct query_node *qun; for (qun= outstanding.head;