summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2018-11-09parse only option 60Pablo Mazzini
2018-11-06[ztp] add Opt60 (vc) and Opt124 (vico) parsingPablo Mazzini
2018-11-06[WIP] Added DHCPv4 server (#178)insomniac
* Added DHCPv4 server * Added more modifiers * Fixed some bugs
2018-10-28Updated README.md to include fbenderAndrea Barberio
2018-10-26Building with Go 1.11 stable instead of rc1Andrea Barberio
2018-10-18Make listening port for dhcpv4 client configurable (#179)Gianni Vialetto
2018-10-17Custom client/server addresses/ports for DHCPv4 client (#172)Gianni Vialetto
2018-10-16OptIAPrefix: sub-options (#177)Pablo Mazzini
2018-10-15OptIAForPrefixDelegation: make fields public (#176)Pablo Mazzini
2018-10-15Added String methods for types (#175)Pablo Mazzini
2018-10-12Merge pull request #173 from knweiss/statuscodesPablo Mazzini
statuscodes: Add RFC 5007/5460/7653/8156 status codes
2018-10-12statuscodes: Add RFC 5007/5460/7653/8156 status codesKarsten Weiss
2018-10-11Add some more DHCPv6 option tests. (#171)David Barr
* Add some more DHCPv6 option tests. * Remove AddRequestedOption() duplicate detection test due to failing on Go 1.9
2018-10-09Avoid panic on malformed OptIAPrefixDavid Barr
2018-10-08Merge pull request #169 from insomniacslk/fix_exchange_v4Sean Karlage
dhcpv4: fix but in Exchange where a nil packet is returned if send fails
2018-10-08dhcpv4: fix but in Exchange where a nil packet is returned if send failsAndrea Barberio
2018-10-07DHCPv4: syscall -> x/sys/unixSean Karlage
Fixes #156 Build a simple client like so: ``` package main import ( "fmt" "time" "github.com/insomniacslk/dhcp/dhcpv4" ) func main() { client := dhcpv4.Client{ReadTimeout: 5 * time.Second, WriteTimeout: 5 * time.Second} conversation, err := client.Exchange("en0", nil) if err != nil { fmt.Println(err) } for _, m := range conversation { fmt.Println(m.Summary()) } } ``` and run: ``` $ sudo ./main Password: DHCPv4 opcode=BootRequest hwtype=Ethernet hwaddrlen=6 hopcount=0 transactionid=0xabfad715 numseconds=0 flags=Broadcast (0x8000) clientipaddr=0.0.0.0 youripaddr=0.0.0.0 serveripaddr=0.0.0.0 gatewayipaddr=0.0.0.0 clienthwaddr=8c:85:90:20:2e:33 serverhostname= bootfilename= options= DHCP Message Type -> DISCOVER Parameter Request List -> [Subnet Mask, Router, Domain Name, Domain Name Server] End -> [] DHCPv4 opcode=BootReply hwtype=Ethernet hwaddrlen=6 hopcount=0 transactionid=0xabfad715 numseconds=0 flags=Broadcast (0x8000) clientipaddr=0.0.0.0 youripaddr=192.168.0.105 serveripaddr=0.0.0.0 gatewayipaddr=0.0.0.0 clienthwaddr=8c:85:90:20:2e:33 serverhostname= bootfilename= options= DHCP Message Type -> OFFER Server Identifier -> 192.168.0.1 IP Addresses Lease Time -> 5648 Subnet Mask -> ffffff00 Routers -> 192.168.0.1 Domain Name Servers -> 8.8.8.8, 8.8.4.4 End -> [] DHCPv4 opcode=BootRequest hwtype=Ethernet hwaddrlen=6 hopcount=0 transactionid=0xabfad715 numseconds=0 flags=Broadcast (0x8000) clientipaddr=0.0.0.0 youripaddr=0.0.0.0 serveripaddr=192.168.0.1 gatewayipaddr=0.0.0.0 clienthwaddr=8c:85:90:20:2e:33 serverhostname= bootfilename= options= DHCP Message Type -> REQUEST Requested IP Address -> 192.168.0.105 Server Identifier -> 192.168.0.1 End -> [] DHCPv4 opcode=BootReply hwtype=Ethernet hwaddrlen=6 hopcount=0 transactionid=0xabfad715 numseconds=0 flags=Broadcast (0x8000) clientipaddr=0.0.0.0 youripaddr=192.168.0.105 serveripaddr=0.0.0.0 gatewayipaddr=0.0.0.0 clienthwaddr=8c:85:90:20:2e:33 serverhostname= bootfilename= options= DHCP Message Type -> ACK Server Identifier -> 192.168.0.1 IP Addresses Lease Time -> 7200 Subnet Mask -> ffffff00 Routers -> 192.168.0.1 Domain Name Servers -> 8.8.8.8, 8.8.4.4 End -> [] ```
2018-10-06Dynamically determine loopback interface for server test (#167)David Barr
* Dynamically determine loopback interface for server test "lo" isn't configured everywhere. In FreeBSD for example, TestServerActivateAndServe() fails as the loopback address is "lo0", not "lo". Also, I don't believe the Zone is required for net.UDPAddr as ::1 is being used, not an fe80:: address. * Add error handling to getLoopbackInterface() - My editor also snuck in some space indentation
2018-10-06Add support for DHCPv6-PD sub-options (#166)David Barr
2018-10-03dhcpv4: Add OptRootPath (#163)Sean Karlage
* dhcpv4: Add OptRootPath Adds a root path option that supports DHCPv4 option 17 * Add root path parsing to giant option parsing switch
2018-10-03BSDP: Fix MessageTypeFromPacket to return a pointerSean Karlage
As @insomiacslk pointed out in #161, it's probably better to return a pointer rather than a (MessageType, bool) combo.
2018-10-01Merge pull request #161 from get9/bsdp-message-type-helperSean Karlage
BSDP: Add MessageTypeFromPacket helper
2018-10-01add commentSean Karlage
2018-10-01BSDP: Add MessageTypeFromPacket helperSean Karlage
This is a helper function to extract the BSDP message type from a given `dhcpv4.DHCPv4` packet structure. It's useful in helping to identify what kind of BSDP packet you're dealing with (since the distinction is only made in one of the vendor-specific options encapsulated in Option 43).
2018-09-30Added listener timeout to the dhcpv6 clientAndrea Barberio
2018-09-29BSDP: Fix parsing offset for boot image listsSean Karlage
While parsing boot images, the current code reads to the end of the data stream; however, this could lead to reading past the boot image option and reading into the next option. Instead, contain how far the option parsing code reads by only looking at the max length specified in the option.
2018-09-27Implemented basic DHCPv6 server handler (#157)insomniac
2018-09-27Addressed feedbackAndrea Barberio
2018-09-27fix race conditionsAndrea Barberio
2018-09-27linterAndrea Barberio
2018-09-27Proper response handler in testAndrea Barberio
2018-09-27LinterAndrea Barberio
2018-09-27Async read and testsAndrea Barberio
2018-09-27Added client and server constructor testsAndrea Barberio
2018-09-27Avoid router7 check on go1.9Andrea Barberio
2018-09-27linterAndrea Barberio
2018-09-27Implemented basic DHCPv6 server handlerAndrea Barberio
2018-09-20Add NoPrefixAvail status code (#155)Dave Barr
As per https://www.ietf.org/rfc/rfc3633.txt section 16, status code 6 has been reserved for "Delegating router has no prefixes available to assign to the IAPD(s)"
2018-09-17Merge pull request #154 from pmazzini/infrequestPablo Mazzini
NewReplyFromDHCPv6Message: reply to information request
2018-09-12NewReplyFromDHCPv6Message: reply to information requestPablo Mazzini
2018-09-10Removed workaround for pcapgo.OpenEthernet from tests (#153)insomniac
2018-09-06Test that we do not break router7 builds (#152)insomniac
2018-08-31GetGlobalAddr utility function (#81)Mikołaj Walczak
2018-08-30Updated README.md (#151)insomniac
* Update README.md * Update README.md (#150)
2018-08-24DHCPv4 relay modifier (#149)Mikołaj Walczak
2018-08-22add OptVendorClass (#148)Pablo Mazzini
2018-08-22Requested Options modifier for DHCPv4 (#147)Mikołaj Walczak
2018-08-21fix ParseOptVIVC (#146)Pablo Mazzini
2018-08-21Remove depracated function calls from the library (#145)Mikołaj Walczak
2018-08-20ORO Modifier (#144)Mikołaj Walczak