On Tue, Sep 3, 2013 at 12:48 PM, krolaw <
kro...@gmail.com> wrote:
> I see that Multicast can bind to an interface, so I hope I'm missing
> something straight forward. I'm also open to alternative elegant solutions.
I guess, no, unfortunately there's no solution to make things easier or smarter.
If you really need DHCP stuff, I usually recommend to kick it by using
os/exec package.
But if you really want to fill up your curiosity, FWIW, here is a
short summary of how to implement DHCP stuff in Go, no warranty.
Required components:
1. Transport
1.1. BPF, LSF or similar stuff (for bootstrapping)
1.2. UDP socket (when you don't want to use BPF/LSF after bootstrapping)
2. Information base
2.1. Address block information base
2.2. Lease information base
2.3. Network facility information base
3. Protocol
3.1. BOOTP messages and options encoder, decoder
3.2. DHCP messages and options encoder, decoder
3.3. Client FSM
3.4. Server FSM
3.5. Relay-agent FSM
4. System adaptation
4.1. Routing socket or netlink socket for capturing and re-configuring
network state inside the kernel
4.2. Configuration, operation and monitoring stuff
5. Security
(snip)
6. High availability (optional)
6.1. Something that makes information base resilient
6.2. Something that makes network resilient
Hope this helps.