Reorganising packet log messages

This commit is contained in:
Dom 2023-11-14 22:41:27 +00:00
parent 93c412d0cd
commit dd15af6674
2 changed files with 61 additions and 59 deletions

View File

@ -354,8 +354,8 @@ class DHCPServer(object):
if packet_options[53] == 1:
log('Received DHCP discover packet', 'info')
offer_packet = Packet.construct_reply_packet(received_packet, 'offer', source_address, topology, self.SETTINGS)
log('Constructing DHCP offer packet...', 'info')
offer_packet = Packet.construct_reply_packet(received_packet, 'offer', source_address, topology, self.SETTINGS)
packet_data, packet_options, option_descriptions = Packet.examine_packet(offer_packet)
log(f'Offer packet options:', 'info')
for option_number, option_value in packet_options.items():
@ -364,8 +364,8 @@ class DHCPServer(object):
elif packet_options[53] == 3:
log('Received DHCP request packet', 'info')
ack_packet = Packet.construct_reply_packet(offer_packet, 'ack', source_address, topology, self.SETTINGS)
log('Constructing DHCP ack packet...', 'info')
ack_packet = Packet.construct_reply_packet(offer_packet, 'ack', source_address, topology, self.SETTINGS)
packet_data, packet_options, option_descriptions = Packet.examine_packet(ack_packet)
log(f'Ack packet options:', 'info')
for option_number, option_value in packet_options.items():

View File

@ -1,57 +1,59 @@
2023-04-07 20:17:16,743 [INFO] 👾 | Building topology...
2023-04-07 20:17:16,793 [INFO] 👾 | Topology name: Lab
2023-04-07 20:17:16,796 [INFO] 👾 | Drawing topology...
2023-04-07 20:17:17,538 [INFO] 👾 | Topology drawn, saved as: topology/topology.png
2023-04-07 20:17:17,540 [INFO] 👾 | Topology build complete
2023-04-07 20:17:17,543 [INFO] 👽 | Rendering configs...
2023-04-07 20:17:17,575 [INFO] 👽 | Rendered /srv/tftp/configs/LAB-897VA.conf
2023-04-07 20:17:17,597 [INFO] 👽 | Rendered /srv/tftp/configs/LAB-SRX300.conf
2023-04-07 20:17:17,599 [INFO] 👽 | Config rendering complete
2023-04-07 20:17:17,602 [INFO] 🤖 | DHCP server is starting...
2023-04-07 20:17:17,604 [INFO] 🤖 | Waiting for DHCP packets...
2023-04-07 20:19:23,166 [INFO] 🤖 | DHCP packet received from IP 10.0.0.0 on port 67
2023-04-07 20:19:23,169 [INFO] 🤖 | Received packet options:
2023-04-07 20:19:23,172 [INFO] 🤖 | 53 [DHCP Message Type]: 1
2023-04-07 20:19:23,175 [INFO] 🤖 | 51 [IP Address Lease Time]: 86400
2023-04-07 20:19:23,178 [INFO] 🤖 | 12 [Hostname]: LAB-SRX300
2023-04-07 20:19:23,180 [INFO] 🤖 | Received DHCP discover packet
2023-04-07 20:19:23,183 [INFO] 👾 | Saw client: LAB-SRX300
2023-04-07 20:19:23,186 [INFO] 👾 | OS: junos
2023-04-07 20:19:23,188 [INFO] 🤖 | Constructing DHCP offer packet...
2023-04-07 20:19:23,191 [INFO] 🤖 | Offer packet options:
2023-04-07 20:19:23,193 [INFO] 🤖 | 53 [DHCP Message Type]: 2
2023-04-07 20:19:23,196 [INFO] 🤖 | 54 [DHCP Server IP Address]: 172.16.0.200
2023-04-07 20:19:23,198 [INFO] 🤖 | 51 [IP Address Lease Time]: 86400
2023-04-07 20:19:23,200 [INFO] 🤖 | 1 [Subnet Mask]: 255.255.255.254
2023-04-07 20:19:23,202 [INFO] 🤖 | 3 [Default Gateway]: 10.0.0.0
2023-04-07 20:19:23,205 [INFO] 🤖 | 150 [TFTP Server IP Address]: 172.16.0.200
2023-04-07 20:19:23,207 [INFO] 🤖 | 43 [Vendor Specific Information]: /configs/LAB-SRX300.conftftp
2023-04-07 20:19:23,209 [INFO] 🤖 | Waiting for DHCP packets...
2023-04-07 20:19:23,212 [INFO] 🤖 | DHCP packet received from IP 10.0.0.0 on port 67
2023-04-07 20:19:23,215 [INFO] 🤖 | Received packet options:
2023-04-07 20:19:23,217 [INFO] 🤖 | 54 [DHCP Server IP Address]: 172.16.0.200
2023-04-07 20:19:23,219 [INFO] 🤖 | 55 [Parameter Request List]: [3, 51, 1, 15, 6, 66, 67, 120, 44, 43, 150, 12, 7, 42]
2023-04-07 20:19:23,221 [INFO] 🤖 | 50 [Requested IP Address]: 10.0.0.1
2023-04-07 20:19:23,223 [INFO] 🤖 | 53 [DHCP Message Type]: 3
2023-04-07 20:19:23,225 [INFO] 🤖 | 51 [IP Address Lease Time]: 86400
2023-04-07 20:19:23,227 [INFO] 🤖 | 12 [Hostname]: LAB-SRX300
2023-04-07 20:19:23,229 [INFO] 🤖 | Received DHCP request packet
2023-04-07 20:19:23,231 [INFO] 🤖 | Constructing DHCP ack packet...
2023-04-07 20:19:23,233 [INFO] 🤖 | Ack packet options:
2023-04-07 20:19:23,235 [INFO] 🤖 | 53 [DHCP Message Type]: 5
2023-04-07 20:19:23,237 [INFO] 🤖 | 54 [DHCP Server IP Address]: 172.16.0.200
2023-04-07 20:19:23,239 [INFO] 🤖 | 51 [IP Address Lease Time]: 86400
2023-04-07 20:19:23,241 [INFO] 🤖 | 1 [Subnet Mask]: 255.255.255.254
2023-04-07 20:19:23,243 [INFO] 🤖 | 3 [Default Gateway]: 10.0.0.0
2023-04-07 20:19:23,245 [INFO] 🤖 | 150 [TFTP Server IP Address]: 172.16.0.200
2023-04-07 20:19:23,247 [INFO] 🤖 | 43 [Vendor Specific Information]: /configs/LAB-SRX300.conftftp
2023-04-07 20:19:23,249 [INFO] 🤖 | Waiting for DHCP packets...
2023-04-07 20:22:32,406 [INFO] 🤖 | DHCP packet received from IP 10.0.0.1 on port 68
2023-04-07 20:22:32,410 [INFO] 🤖 | Received packet options:
2023-04-07 20:22:32,413 [INFO] 🤖 | 54 [DHCP Server IP Address]: 172.16.0.200
2023-04-07 20:22:32,417 [INFO] 🤖 | 53 [DHCP Message Type]: 7
2023-04-07 20:22:32,419 [INFO] 🤖 | 12 [Hostname]: LAB-SRX300
2023-04-07 20:22:32,421 [INFO] 🤖 | Received DHCP release packet
2023-04-07 20:22:32,422 [INFO] 🤖 | See you around, partner🤠
2023-04-07 20:22:32,424 [INFO] 🤖 | Waiting for DHCP packets...
2023-04-07 20:23:00,802 [INFO] 🤖 | Exiting...
2023-11-14 22:25:19,838 [INFO] 👾 | Building topology...
2023-11-14 22:25:19,847 [INFO] 👾 | Topology name: Lab
2023-11-14 22:25:19,848 [INFO] 👾 | Drawing topology...
2023-11-14 22:25:19,991 [INFO] 👾 | Topology drawn, saved as: topology/topology.png
2023-11-14 22:25:19,991 [INFO] 👾 | Topology build complete
2023-11-14 22:25:19,992 [INFO] 👽 | Rendering configs...
2023-11-14 22:25:19,996 [INFO] 👽 | Rendered /srv/tftp/configs/LAB-897VA.conf
2023-11-14 22:25:19,998 [INFO] 👽 | Rendered /srv/tftp/configs/LAB-SRX300.conf
2023-11-14 22:25:19,999 [INFO] 👽 | Config rendering complete
2023-11-14 22:25:20,000 [INFO] 🤖 | DHCP server is starting...
2023-11-14 22:25:20,000 [INFO] 🤖 | DHCP server IP: 192.168.0.247 running on port 67
2023-11-14 22:25:20,001 [INFO] 🤖 | TFTP server IP: 192.168.0.247
2023-11-14 22:25:20,001 [INFO] 🤖 | Waiting for DHCP packets...
2023-11-14 22:26:26,595 [INFO] 🤖 | DHCP packet received from IP 10.0.0.0 on port 67
2023-11-14 22:26:26,595 [INFO] 🤖 | Received packet options:
2023-11-14 22:26:26,596 [INFO] 🤖 | 53 [DHCP Message Type]: 1
2023-11-14 22:26:26,597 [INFO] 🤖 | 51 [IP Address Lease Time]: 86400
2023-11-14 22:26:26,597 [INFO] 🤖 | 12 [Hostname]: LAB-SRX300
2023-11-14 22:26:26,598 [INFO] 🤖 | Received DHCP discover packet
2023-11-14 22:26:26,599 [INFO] 🤖 | Constructing DHCP offer packet...
2023-11-14 22:26:26,600 [INFO] 👾 | Saw client: LAB-SRX300
2023-11-14 22:26:26,601 [INFO] 👾 | OS: junos
2023-11-14 22:26:26,602 [INFO] 🤖 | Offer packet options:
2023-11-14 22:26:26,602 [INFO] 🤖 | 53 [DHCP Message Type]: 2
2023-11-14 22:26:26,603 [INFO] 🤖 | 54 [DHCP Server IP Address]: 192.168.0.247
2023-11-14 22:26:26,604 [INFO] 🤖 | 51 [IP Address Lease Time]: 86400
2023-11-14 22:26:26,604 [INFO] 🤖 | 1 [Subnet Mask]: 255.255.255.254
2023-11-14 22:26:26,605 [INFO] 🤖 | 3 [Default Gateway]: 10.0.0.0
2023-11-14 22:26:26,606 [INFO] 🤖 | 150 [TFTP Server IP Address]: 192.168.0.247
2023-11-14 22:26:26,606 [INFO] 🤖 | 43 [Vendor Specific Information]: /configs/LAB-SRX300.conftftp
2023-11-14 22:26:26,607 [INFO] 🤖 | Waiting for DHCP packets...
2023-11-14 22:26:26,611 [INFO] 🤖 | DHCP packet received from IP 10.0.0.0 on port 67
2023-11-14 22:26:26,611 [INFO] 🤖 | Received packet options:
2023-11-14 22:26:26,612 [INFO] 🤖 | 54 [DHCP Server IP Address]: 192.168.0.247
2023-11-14 22:26:26,613 [INFO] 🤖 | 55 [Parameter Request List]: [3, 51, 1, 15, 6, 66, 67, 120, 44, 43, 150, 12, 7, 42]
2023-11-14 22:26:26,614 [INFO] 🤖 | 50 [Requested IP Address]: 10.0.0.1
2023-11-14 22:26:26,614 [INFO] 🤖 | 53 [DHCP Message Type]: 3
2023-11-14 22:26:26,614 [INFO] 🤖 | 51 [IP Address Lease Time]: 86400
2023-11-14 22:26:26,615 [INFO] 🤖 | 12 [Hostname]: LAB-SRX300
2023-11-14 22:26:26,615 [INFO] 🤖 | Received DHCP request packet
2023-11-14 22:26:26,615 [INFO] 🤖 | Constructing DHCP ack packet...
2023-11-14 22:26:26,616 [INFO] 🤖 | Ack packet options:
2023-11-14 22:26:26,616 [INFO] 🤖 | 53 [DHCP Message Type]: 5
2023-11-14 22:26:26,617 [INFO] 🤖 | 54 [DHCP Server IP Address]: 192.168.0.247
2023-11-14 22:26:26,617 [INFO] 🤖 | 51 [IP Address Lease Time]: 86400
2023-11-14 22:26:26,618 [INFO] 🤖 | 1 [Subnet Mask]: 255.255.255.254
2023-11-14 22:26:26,618 [INFO] 🤖 | 3 [Default Gateway]: 10.0.0.0
2023-11-14 22:26:26,618 [INFO] 🤖 | 150 [TFTP Server IP Address]: 192.168.0.247
2023-11-14 22:26:26,619 [INFO] 🤖 | 43 [Vendor Specific Information]: /configs/LAB-SRX300.conftftp
2023-11-14 22:26:26,619 [INFO] 🤖 | Waiting for DHCP packets...
2023-11-14 22:28:32,911 [INFO] 🤖 | DHCP packet received from IP 10.0.0.1 on port 68
2023-11-14 22:28:32,911 [INFO] 🤖 | Received packet options:
2023-11-14 22:28:32,912 [INFO] 🤖 | 54 [DHCP Server IP Address]: 192.168.0.247
2023-11-14 22:28:32,913 [INFO] 🤖 | 53 [DHCP Message Type]: 7
2023-11-14 22:28:32,914 [INFO] 🤖 | 12 [Hostname]: LAB-SRX300
2023-11-14 22:28:32,915 [INFO] 🤖 | Received DHCP release packet
2023-11-14 22:28:32,915 [INFO] 🤖 | See you around, partner🤠
2023-11-14 22:28:32,916 [INFO] 🤖 | Waiting for DHCP packets...
2023-11-14 22:40:22,461 [INFO] 🤖 | Exiting...