Age | Commit message (Collapse) | Author | |
---|---|---|---|
2018-10-18 | Make listening port for dhcpv4 client configurable (#179) | Gianni Vialetto | |
2018-10-17 | Custom client/server addresses/ports for DHCPv4 client (#172) | Gianni Vialetto | |
2018-10-15 | Added String methods for types (#175) | Pablo Mazzini | |
2018-10-08 | dhcpv4: fix but in Exchange where a nil packet is returned if send fails | Andrea Barberio | |
2018-10-07 | DHCPv4: syscall -> x/sys/unix | Sean 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-03 | dhcpv4: 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-03 | BSDP: Fix MessageTypeFromPacket to return a pointer | Sean Karlage | |
As @insomiacslk pointed out in #161, it's probably better to return a pointer rather than a (MessageType, bool) combo. | |||
2018-10-01 | add comment | Sean Karlage | |
2018-10-01 | BSDP: Add MessageTypeFromPacket helper | Sean 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-29 | BSDP: Fix parsing offset for boot image lists | Sean 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-08-24 | DHCPv4 relay modifier (#149) | Mikołaj Walczak | |
2018-08-22 | Requested Options modifier for DHCPv4 (#147) | Mikołaj Walczak | |
2018-08-21 | fix ParseOptVIVC (#146) | Pablo Mazzini | |
2018-08-20 | Async DHCPv4 client (#134) | Mikołaj Walczak | |
2018-08-19 | Added String methods for types (#140) | insomniac | |
* Added String methods for types * Reverted change on bsdp.OptionCode | |||
2018-08-15 | refactor tests to take advantage of new helper functions | Sean Karlage | |
2018-08-15 | Merge branch 'master' into bsdp-acks | Sean Karlage | |
2018-08-15 | Put back NewInformListForInterface to maintain compat | Sean Karlage | |
2018-08-15 | revert breaking changes so this can be merged without issues | Sean Karlage | |
2018-08-15 | Merge branch 'master' into dhcpv4-moar-tests | Sean Karlage | |
2018-08-15 | Add nil check for Images slice | Sean Karlage | |
2018-08-15 | Merge branch 'master' into bsdp-acks | Sean Karlage | |
2018-08-15 | stop parsing after end (#132) | Pablo Mazzini | |
2018-08-14 | BSDP: Add code to generate ACKs for INFORMs | Sean Karlage | |
2018-08-13 | BSDP: Exchange returns list of pointers, not list of objects | Andrea Barberio | |
2018-08-13 | fix OptClientArchType | Pablo Mazzini | |
2018-08-13 | add IsOptionRequested (#122) | insomniac | |
2018-08-12 | IsOptionRequested method of DHCPv6Message | Pablo Mazzini | |
2018-08-11 | Merge branch 'master' into dhcpv4-moar-tests | Sean Karlage | |
2018-08-10 | rename IsRequested to IsRequestedOption | Pablo Mazzini | |
2018-08-10 | IsRequested: update comment | Pablo Mazzini | |
2018-08-10 | add IsRequested | Pablo Mazzini | |
2018-08-10 | OptTFTPServerName and OptBootfileName test String | Pablo Mazzini | |
2018-08-10 | NewRequestFromOffer: update client | Pablo Mazzini | |
2018-08-10 | NewRequestFromOffer: update client | Pablo Mazzini | |
2018-08-10 | OptTFTPServerName: fix String() | Pablo Mazzini | |
2018-08-10 | rename RequestFromOffer to NewRequestFromOffer | Pablo Mazzini | |
2018-08-10 | Added modifier for netbootv4 (#124) | Owen Mooney | |
2018-08-02 | OptClientArchType: increase coverage | Pablo Mazzini | |
2018-08-02 | OptClientArchType: increase coverage | Pablo Mazzini | |
2018-08-02 | OptClientArchType: increase coverage | Pablo Mazzini | |
2018-08-02 | OptClientArchType: increase coverage | Pablo Mazzini | |
2018-08-02 | OptClientArchType: increase coverage | Pablo Mazzini | |
2018-08-02 | OptClientArchType | Pablo Mazzini | |
2018-08-02 | OptClientArchType | Pablo Mazzini | |
2018-08-02 | OptClientArchType | Pablo Mazzini | |
2018-08-02 | OptClientArchType: add comments | Pablo Mazzini | |
2018-08-02 | add OptClientArchType | Pablo Mazzini | |
2018-08-02 | OptUserClass: use only the flag as authoritative | Pablo Mazzini | |
2018-08-02 | OptUserClass: fix short length | Pablo Mazzini | |