From: Remi Gacogne Date: Fri, 28 Sep 2018 14:08:10 +0000 (+0200) Subject: ProtobufLogger: Add support for the ServerIdentity field X-Git-Tag: dnsdist-1.3.3~77^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F7004%2Fhead;p=thirdparty%2Fpdns.git ProtobufLogger: Add support for the ServerIdentity field --- diff --git a/contrib/ProtobufLogger.py b/contrib/ProtobufLogger.py index 66f6d53939..7e9af015b8 100644 --- a/contrib/ProtobufLogger.py +++ b/contrib/ProtobufLogger.py @@ -152,9 +152,14 @@ class PDNSPBConnHandler(object): protostr = 'TCP' messageidstr = binascii.hexlify(bytearray(msg.messageId)) + + serveridstr = 'N/A' + if msg.HasField('serverIdentity'): + serveridstr = msg.serverIdentity + initialrequestidstr = '' if msg.HasField('initialRequestId'): - initialrequestidstr = ', initial uuid: ' + binascii.hexlify(bytearray(msg.initialRequestId)) + initialrequestidstr = ', initial uuid: %s ' % (binascii.hexlify(bytearray(msg.initialRequestId))) requestorstr = '' requestor = self.getRequestorSubnet(msg) @@ -165,7 +170,7 @@ class PDNSPBConnHandler(object): requestorId = msg.requestorId print('[%s] %s of size %d: %s%s -> %s (%s), id: %d, uuid: %s%s ' - 'requestorid: %s deviceid: %s' % (datestr, + 'requestorid: %s deviceid: %s serverid: %s' % (datestr, typestr, msg.inBytes, ipfromstr, @@ -176,7 +181,8 @@ class PDNSPBConnHandler(object): messageidstr, initialrequestidstr, requestorId, - deviceId)) + deviceId, + serveridstr)) def getRequestorSubnet(self, msg): requestorstr = None