uint16_t d_pos;
bool eof() { return true; };
+ const string getRemaining() const {
+ return "";
+ };
private:
uint16_t d_startrecordpos; // needed for getBlob later on
void RNAME##RecordContent::xfrPacket(Convertor& conv, bool noDot) \
{ \
CONV; \
- if (conv.eof() == false) throw MOADNSException("All data was not consumed"); \
+ if (conv.eof() == false) throw MOADNSException("When parsing " #RNAME " trailing data was not parsed: '" + conv.getRemaining() + "'"); \
} \
struct EDNSOpts
}
bool eof() { return true; } // we don't know how long the record should be
+ const string getRemaining() const {
+ return "";
+ }
private:
uint16_t lookupName(const DNSName& name, uint16_t* matchlen);
vector<uint16_t> d_namepositions;
void xfrBlobNoSpaces(string& val, int len=-1);
void xfrBlob(string& val, int len=-1);
+ const string getRemaining() const {
+ return d_string.substr(d_pos);
+ }
+
bool eof();
private:
string d_string;
void xfrBlob(const string& val, int len=-1);
void xfrHexBlob(const string& val, bool keepReading=false);
bool eof() { return true; };
+
+ const string getRemaining() const {
+ return "";
+ }
private:
string& d_string;
bool d_nodot;