-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make multicast_address
optional
#21
Comments
I'm not as familiar with the protocol, so take that in consideration for the next comments. It would help me if you could share an
Not at all :) Feel free to keep posting issues, I just can't promise you any fast response tho.
I think a |
I guess I should explain BOOTP a little better, as it may help. The existing way to specify a port won't work, because it forces me to pick a multicast group (which BOOTP doesn't have). BOOTP is pretty much just DHCP (DHCP is actually an extension of the BOOTP protocol). A good chunk of embedded devices' bootloaders will
The pseudocode would be something like: let mut socket = MulticastSocket::new_on_port_only(67); // broadcast only, no multicast ADD_MEMBERSHIP
while let message = socket.recv() {
if !valid_bootp_packet(message.data) {
continue;
}
let mut reply = create_bootp_response(message.data);
reply.to = message.origin_address;
reply.server_addr = message.interface.ip;
socket.send_to(&message.interface, &reply.to_vec(), INADDR_BROADCAST);
} |
I'd like to use this library to program a device that uses BOOTP. BOOTP benefits greatly from the "which interface did this packet come from" aspect of the library, but uses broadcast packets instead of multicast. Specifically, you'd listen on all ports for a BOOTP request, then reply to the port it came from to start upload.
Before I start work, I'd like to check on the best way to implement
MulticastSocket::all_interfaces/with_options
- Change the argument to anOption<>
, or move it into the options struct with a default of "no group"? I don't think it's possible to avoid an API break, unless you'd prefer newall_interfaces_without_group
or somethingMulticastSocket::send
- split intosend
with an address andsend_to_group
, or keepsend
as-is and addsend_to
?p.s. I hope you're not too bothered by all my activity! Basically, I have an unpublished crate similar to multicast-socket, but then I found yours which uses far fewer resources, doesn't need threads, works properly on Linux etc... So I'm slowly bringing across features so I can drop my terrible impl.
The text was updated successfully, but these errors were encountered: