mirror of
https://github.com/maride/pancap.git
synced 2026-04-24 06:35:46 +00:00
Reformat code
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
package dhcpv4
|
||||
|
||||
import (
|
||||
"github.com/maride/pancap/output"
|
||||
"github.com/google/gopacket"
|
||||
"github.com/google/gopacket/layers"
|
||||
"github.com/maride/pancap/output"
|
||||
)
|
||||
|
||||
type Protocol struct {
|
||||
hostnames []hostname
|
||||
hostnames []hostname
|
||||
networkSetup map[layers.DHCPOpt][]byte
|
||||
requestMAC []string
|
||||
responses []dhcpResponse
|
||||
requestMAC []string
|
||||
responses []dhcpResponse
|
||||
}
|
||||
|
||||
// Checks if the given packet is a DHCP packet we can process
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package dhcpv4
|
||||
|
||||
type dhcpResponse struct {
|
||||
destMACAddr string
|
||||
newIPAddr string
|
||||
destMACAddr string
|
||||
newIPAddr string
|
||||
serverMACAddr string
|
||||
askedFor bool
|
||||
askedFor bool
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package dhcpv4
|
||||
|
||||
type hostname struct {
|
||||
hostname string
|
||||
hostname string
|
||||
requestedByMAC string
|
||||
granted bool
|
||||
granted bool
|
||||
deniedHostname string
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package dhcpv4
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/maride/pancap/common"
|
||||
"github.com/google/gopacket/layers"
|
||||
"github.com/maride/pancap/common"
|
||||
"log"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ import (
|
||||
|
||||
var (
|
||||
watchedOpts = []layers.DHCPOpt{
|
||||
layers.DHCPOptSubnetMask, // Option 1
|
||||
layers.DHCPOptRouter, // Option 3
|
||||
layers.DHCPOptDNS, // Option 6
|
||||
layers.DHCPOptSubnetMask, // Option 1
|
||||
layers.DHCPOptRouter, // Option 3
|
||||
layers.DHCPOptDNS, // Option 6
|
||||
layers.DHCPOptBroadcastAddr, // Option 28
|
||||
layers.DHCPOptNTPServers, // Option 42
|
||||
layers.DHCPOptLeaseTime, // Option 51
|
||||
layers.DHCPOptT1, // Option 58
|
||||
layers.DHCPOptNTPServers, // Option 42
|
||||
layers.DHCPOptLeaseTime, // Option 51
|
||||
layers.DHCPOptT1, // Option 58
|
||||
}
|
||||
)
|
||||
|
||||
@@ -126,7 +126,7 @@ func formatDate(rawDate []byte) (string, bool) {
|
||||
intDate := binary.LittleEndian.Uint32(rawDate)
|
||||
seconds := intDate % 60
|
||||
minutes := intDate / 60 % 60
|
||||
hours := intDate / 60 / 60 % 60
|
||||
hours := intDate / 60 / 60 % 60
|
||||
formattedDate := ""
|
||||
|
||||
// Check which words we need to pick
|
||||
|
||||
@@ -2,8 +2,8 @@ package dhcpv4
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/maride/pancap/common"
|
||||
"github.com/google/gopacket/layers"
|
||||
"github.com/maride/pancap/common"
|
||||
)
|
||||
|
||||
// Processes the DHCP request packet handed over
|
||||
|
||||
@@ -2,8 +2,8 @@ package dhcpv4
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/maride/pancap/common"
|
||||
"github.com/google/gopacket/layers"
|
||||
"github.com/maride/pancap/common"
|
||||
"log"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user