summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index bc1e6a8..ed61942 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,5 @@
use socket2::{Domain, Protocol, Socket, Type};
+use std::net::Ipv4Addr;
struct Init;
struct Master;
@@ -41,8 +42,16 @@ fn run() {
fn main() {
let res = Socket::new(Domain::IPV4, Type::RAW, Some(Protocol::from(112)));
- let Ok(_sock) = res else {
+ let Ok(sock) = res else {
eprintln!("Socket::new(): {}", res.err().unwrap());
std::process::exit(1);
};
+ let res = sock.join_multicast_v4(
+ &Ipv4Addr::new(224, 0, 0, 18),
+ &Ipv4Addr::UNSPECIFIED,
+ );
+ let Ok(_) = res else {
+ eprintln!("join_multicast_v4(): {}", res.err().unwrap());
+ std::process::exit(1);
+ };
}