2019-11-28 18:38:41 +00:00
|
|
|
package dhcpv4
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2019-11-29 13:32:07 +00:00
|
|
|
"git.darknebu.la/maride/pancap/common"
|
2019-11-28 18:38:41 +00:00
|
|
|
"github.com/google/gopacket/layers"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
requestMAC []string
|
|
|
|
)
|
|
|
|
|
|
|
|
// Processes the DHCP request packet handed over
|
|
|
|
func processRequestPacket(dhcppacket layers.DHCPv4) {
|
2019-11-29 13:32:07 +00:00
|
|
|
requestMAC = common.AppendIfUnique(dhcppacket.ClientHWAddr.String(), requestMAC)
|
2019-11-28 18:38:41 +00:00
|
|
|
}
|
|
|
|
|
2019-12-03 22:51:03 +00:00
|
|
|
// Generates the summary of all DHCP request packets
|
|
|
|
func generateRequestSummary() string {
|
|
|
|
return fmt.Sprintf("%d unique DHCP requests\n%s", len(requestMAC), common.GenerateTree(requestMAC))
|
2019-11-28 18:38:41 +00:00
|
|
|
}
|