Compare commits
2 Commits
7a0880fc02
...
30ebb528eb
Author | SHA1 | Date |
---|---|---|
_ | 30ebb528eb | |
_ | 221a0bef2f |
|
@ -54,7 +54,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lookaround"
|
name = "lookaround"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"mac_address",
|
"mac_address",
|
||||||
"rand",
|
"rand",
|
||||||
|
|
|
@ -9,7 +9,7 @@ license = "AGPL-3.0"
|
||||||
name = "lookaround"
|
name = "lookaround"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://six-five-six-four.com/git/reactor/lookaround"
|
repository = "https://six-five-six-four.com/git/reactor/lookaround"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
mac_address = "1.1.2"
|
mac_address = "1.1.2"
|
||||||
|
|
23
README.md
23
README.md
|
@ -3,9 +3,6 @@
|
||||||
|
|
||||||
_Has this ever happened to you?_
|
_Has this ever happened to you?_
|
||||||
|
|
||||||
LookAround is a Rust program for looking up your computers' MAC and IP addresses
|
|
||||||
within a LAN. There's no central server, so it's not a look-up, it's a look-around.
|
|
||||||
|
|
||||||
```text
|
```text
|
||||||
$ lookaround client
|
$ lookaround client
|
||||||
|
|
||||||
|
@ -15,12 +12,14 @@ Found 3 peers:
|
||||||
33:33:33:33:33:33 = 192.168.1.103 `old-laptop`
|
33:33:33:33:33:33 = 192.168.1.103 `old-laptop`
|
||||||
```
|
```
|
||||||
|
|
||||||
The LookAround client uses IP multicast to find LookAround servers within the
|
LookAround is a Rust program for looking up your computers' MAC and IP addresses
|
||||||
same multicast domain.
|
within a LAN. There's no central server, so it's not a look-up, it's a look-around.
|
||||||
|
|
||||||
MAC addresses change slower than IP addresses, so if you know that
|
The client uses IP multicast to find servers within the
|
||||||
`11:11:11:11:11:11` is your laptop, and your laptop is running LookAround,
|
same multicast domain, similar to Avahi and Bonjour.
|
||||||
LookAround will find the IP for you.
|
|
||||||
|
Systems self-identify by MAC address and nicknames. Public keys with
|
||||||
|
TOFU semantics are intended before v1.0.0.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -57,7 +56,7 @@ systemctl --user enable lookaround
|
||||||
Run the server manually: (If you haven't installed it with systemd yet)
|
Run the server manually: (If you haven't installed it with systemd yet)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
lookaround server
|
lookaround server --nickname my-desktop
|
||||||
```
|
```
|
||||||
|
|
||||||
Run a client to ping all servers in the same multi-cast domain:
|
Run a client to ping all servers in the same multi-cast domain:
|
||||||
|
@ -66,6 +65,12 @@ Run a client to ping all servers in the same multi-cast domain:
|
||||||
lookaround client
|
lookaround client
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Check which IP addresses LookAround will auto-detect:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
lookaround my-ips
|
||||||
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
Pull requests are welcome. This is a hobby project, so I may reject
|
Pull requests are welcome. This is a hobby project, so I may reject
|
||||||
contributions that are too big to review.
|
contributions that are too big to review.
|
||||||
|
|
|
@ -30,7 +30,9 @@ pub async fn client <I : Iterator <Item=String>> (mut args: I) -> Result <(), Ap
|
||||||
let socket = UdpSocket::bind (SocketAddrV4::new (Ipv4Addr::UNSPECIFIED, 0)).await?;
|
let socket = UdpSocket::bind (SocketAddrV4::new (Ipv4Addr::UNSPECIFIED, 0)).await?;
|
||||||
|
|
||||||
for bind_addr in bind_addrs {
|
for bind_addr in bind_addrs {
|
||||||
socket.join_multicast_v4 (common_params.multicast_addr, bind_addr)?;
|
if let Err (e) = socket.join_multicast_v4 (common_params.multicast_addr, bind_addr) {
|
||||||
|
println! ("Error joining multicast group with iface {}: {:?}", bind_addr, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut idem_id = [0u8; 8];
|
let mut idem_id = [0u8; 8];
|
||||||
|
|
|
@ -15,7 +15,9 @@ pub async fn server <I: Iterator <Item=String>> (args: I) -> Result <(), AppErro
|
||||||
let socket = UdpSocket::bind (SocketAddrV4::new (Ipv4Addr::UNSPECIFIED, params.common.server_port)).await?;
|
let socket = UdpSocket::bind (SocketAddrV4::new (Ipv4Addr::UNSPECIFIED, params.common.server_port)).await?;
|
||||||
|
|
||||||
for bind_addr in ¶ms.bind_addrs {
|
for bind_addr in ¶ms.bind_addrs {
|
||||||
socket.join_multicast_v4 (params.common.multicast_addr, *bind_addr)?;
|
if let Err (e) = socket.join_multicast_v4 (params.common.multicast_addr, *bind_addr) {
|
||||||
|
println! ("Error joining multicast group with iface {}: {:?}", bind_addr, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
serve_interface (params, socket).await?;
|
serve_interface (params, socket).await?;
|
||||||
|
|
Loading…
Reference in New Issue