[TASK] do not send multicast request (#121)
This commit is contained in:
parent
c20e216ed6
commit
4e7e2bad46
|
@ -25,6 +25,9 @@ ifname = "br-ffhb"
|
|||
# ip address which is used for sending
|
||||
# (optional - without definition used a address of ifname)
|
||||
ip_address = "fd2f:5119:f2d::5"
|
||||
# disable sending multicast respondd request
|
||||
# (for receiving only respondd packages e.g. database respondd)
|
||||
#send_no_request = false
|
||||
# multicast address to destination of respondd
|
||||
# (optional - without definition used batman default ff02::2:1001)
|
||||
multicast_address = "ff05::2:1001"
|
||||
|
|
|
@ -21,6 +21,7 @@ collect_interval = "1m"
|
|||
[[respondd.interfaces]]
|
||||
ifname = "br-ffhb"
|
||||
#ip_address = "fe80::..."
|
||||
#send_no_request = false
|
||||
#multicast_address = "ff02::2:1001"
|
||||
#port = 10001
|
||||
```
|
||||
|
@ -100,6 +101,7 @@ It is possible to have multiple interfaces, just add this group again with new p
|
|||
[[respondd.interfaces]]
|
||||
ifname = "br-ffhb"
|
||||
#ip_address = "fe80::..."
|
||||
#send_no_request = false
|
||||
#multicast_address = "ff02::2:1001"
|
||||
#port = 10001
|
||||
```
|
||||
|
@ -124,6 +126,16 @@ ip_address = "fe80::..."
|
|||
```
|
||||
{% endmethod %}
|
||||
|
||||
### send_no_request
|
||||
{% method %}
|
||||
Disable sending multicast respondd request.
|
||||
For receiving only respondd packages e.g. database respondd.
|
||||
{% sample lang="toml" %}
|
||||
```toml
|
||||
send_no_request = true
|
||||
```
|
||||
{% endmethod %}
|
||||
|
||||
### multicast_address
|
||||
{% method %}
|
||||
Multicast address to destination of respondd.
|
||||
|
|
|
@ -18,7 +18,6 @@ import (
|
|||
// Collector for a specificle respond messages
|
||||
type Collector struct {
|
||||
connections []multicastConn // UDP sockets
|
||||
port int
|
||||
|
||||
queue chan *Response // received responses
|
||||
db database.Connection
|
||||
|
@ -30,6 +29,7 @@ type Collector struct {
|
|||
|
||||
type multicastConn struct {
|
||||
Conn *net.UDPConn
|
||||
SendRequest bool
|
||||
MulticastAddress net.IP
|
||||
}
|
||||
|
||||
|
@ -89,6 +89,7 @@ func (coll *Collector) listenUDP(iface InterfaceConfig) {
|
|||
|
||||
coll.connections = append(coll.connections, multicastConn{
|
||||
Conn: conn,
|
||||
SendRequest: !iface.SendNoRequest,
|
||||
MulticastAddress: net.ParseIP(multicastAddress),
|
||||
})
|
||||
|
||||
|
@ -163,7 +164,9 @@ func (coll *Collector) sendOnce() {
|
|||
func (coll *Collector) sendMulticast() {
|
||||
log.Println("sending multicasts")
|
||||
for _, conn := range coll.connections {
|
||||
coll.sendPacket(conn.Conn, conn.MulticastAddress)
|
||||
if conn.SendRequest {
|
||||
coll.sendPacket(conn.Conn, conn.MulticastAddress)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ type SiteConfig struct {
|
|||
type InterfaceConfig struct {
|
||||
InterfaceName string `toml:"ifname"`
|
||||
IPAddress string `toml:"ip_address"`
|
||||
SendNoRequest bool `toml:"send_no_request"`
|
||||
MulticastAddress string `toml:"multicast_address"`
|
||||
Port int `toml:"port"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue