From: Christian Hofstaedtler Date: Mon, 26 Jan 2015 23:19:07 +0000 (+0100) Subject: Remove unused convenience methods DNSBackend::getRemote(...) X-Git-Tag: dnsdist-1.0.0-alpha1~306^2~1^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0079dd18dbd65a855011e77d277d0870d4ccbd0e;p=thirdparty%2Fpdns.git Remove unused convenience methods DNSBackend::getRemote(...) --- diff --git a/docs/markdown/appendix/backend-writers-guide.md b/docs/markdown/appendix/backend-writers-guide.md index 63b02a98bd..c8254ad8bf 100644 --- a/docs/markdown/appendix/backend-writers-guide.md +++ b/docs/markdown/appendix/backend-writers-guide.md @@ -190,7 +190,7 @@ Please note that a RandomBackend is actually in most PDNS releases. By default i #### `void lookup(const QType &qtype, const string &qdomain, DNSPacket *pkt=0, int zoneId=-1)` This function is used to initiate a straight lookup for a record of name 'qdomain' and type 'qtype'. A QType can be converted into an integer by invoking its `getCode()` method and into a string with the `getCode()`. -The original question may or may not be passed in the pointer p. If it is, you can retrieve (from 1.99.11 onwards) information about who asked the question with the `getRemote(DNSPacket *)` method. Alternatively, `bool getRemote(struct sockaddr *sa, socklen_t *len)` is available. +The original question may or may not be passed in the pointer pkt. If it is, you can retrieve information about who asked the question with the `pkt->getRemote()` method. Note that **qdomain** can be of any case and that your backend should make sure it is in effect case insensitive. Furthermore, the case of the original question should be retained in answers returned by `get()`! diff --git a/pdns/dnsbackend.cc b/pdns/dnsbackend.cc index 2eb0c67bcd..15123c2e0d 100644 --- a/pdns/dnsbackend.cc +++ b/pdns/dnsbackend.cc @@ -30,20 +30,6 @@ #include "dnspacket.hh" #include "dns.hh" -string DNSBackend::getRemote(DNSPacket *p) -{ - return p->getRemote(); -} - -bool DNSBackend::getRemote(DNSPacket *p, struct sockaddr *sa, Utility::socklen_t *len) -{ - if(p->d_remote.getSocklen() < *len) - return false; - *len=p->d_remote.getSocklen(); - memcpy(sa,&p->d_remote,*len); - return true; -} - bool DNSBackend::getAuth(DNSPacket *p, SOAData *sd, const string &target, int *zoneId, const int best_match_len) { bool found=false; diff --git a/pdns/dnsbackend.hh b/pdns/dnsbackend.hh index 9db293a31e..c02447cb38 100644 --- a/pdns/dnsbackend.hh +++ b/pdns/dnsbackend.hh @@ -378,8 +378,6 @@ protected: bool mustDo(const string &key); const string &getArg(const string &key); int getArgAsNum(const string &key); - string getRemote(DNSPacket *p); - bool getRemote(DNSPacket *p, struct sockaddr *in, Utility::socklen_t *len); private: string d_prefix;