Compare commits
No commits in common. "30ebb528ebdea7f7bb7c6294d631c404854ff6f3" and "7a0880fc02adc53772e792f9faf06a4933f78743" have entirely different histories.
30ebb528eb
...
7a0880fc02
|
@ -54,7 +54,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lookaround"
|
name = "lookaround"
|
||||||
version = "0.1.5"
|
version = "0.1.4"
|
||||||
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.5"
|
version = "0.1.4"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
mac_address = "1.1.2"
|
mac_address = "1.1.2"
|
||||||
|
|
23
README.md
23
README.md
|
@ -3,6 +3,9 @@
|
||||||
|
|
||||||
_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
|
||||||
|
|
||||||
|
@ -12,14 +15,12 @@ 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`
|
||||||
```
|
```
|
||||||
|
|
||||||
LookAround is a Rust program for looking up your computers' MAC and IP addresses
|
The LookAround client uses IP multicast to find LookAround servers within the
|
||||||
within a LAN. There's no central server, so it's not a look-up, it's a look-around.
|
same multicast domain.
|
||||||
|
|
||||||
The client uses IP multicast to find servers within the
|
MAC addresses change slower than IP addresses, so if you know that
|
||||||
same multicast domain, similar to Avahi and Bonjour.
|
`11:11:11:11:11:11` is your laptop, and your laptop is running LookAround,
|
||||||
|
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
|
||||||
|
|
||||||
|
@ -56,7 +57,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 --nickname my-desktop
|
lookaround server
|
||||||
```
|
```
|
||||||
|
|
||||||
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:
|
||||||
|
@ -65,12 +66,6 @@ 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,9 +30,7 @@ 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 {
|
||||||
if let Err (e) = socket.join_multicast_v4 (common_params.multicast_addr, bind_addr) {
|
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,9 +15,7 @@ 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 {
|
||||||
if let Err (e) = socket.join_multicast_v4 (params.common.multicast_addr, *bind_addr) {
|
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