ffnord / ffmap-backend

THIS PROJECT DOESN'T HAVE A MAINTAINER!
Other
20 stars 56 forks source link

add socket support (alfred) #30

Closed kokel closed 9 years ago

kokel commented 10 years ago

Hello,

recently the alfred daemon has been patched to support the configuration for the unix socket path: Link

After this the alfred client alfred-json has also been patched to support this: Link

This allows communities which have currently multiple batman_adv mesh clouds on the same gateway to run one alfred daemon instance for each of the cloud. One implication is that all alfred clients have to patched in order to connect to the correct socket.

So please add support in ffmap-backend for this. Finally, bat2nodes.py should be called with a new command-line-option like -u | --unix-path (alfred daemon style) or -s | --socket (alfred client alfred-json style) in order to return the wanted unix socket to alfred.py and batman.py to make in the mkmap.sh magically stuff like:

./bat2nodes.py -A -s /var/run/alfred0.sock -a somealiases.json -m bat0 -d $DEST
./bat2nodes.py -A -s /var/run/alfred1.sock -a somealiases.json -m bat1 -d $DEST
./bat2nodes.py -A -s /var/run/alfred2.sock -a somealiases.json -m bat2 -d $DEST

And some time later someone should make some brainwork to consider the implications supporting multiple batman_adv mesh clouds in one single map, like e.g. duplicate gateways, vpn links?, etc.

tcatm commented 10 years ago

I think it would be best if -A (which enables alfred support) took an optional parameter specifying the socket. Could you prepare a pull request?

kokel commented 10 years ago

In my opinion the best would be just another option like mentioned above because you have to give the path not only to alfred(). Also batman() needs this for calling batadv-vis correctly.

Sorry, I'm not a propper python programmer, so the code won't come from me.

tcatm commented 9 years ago

This is now implemented.

kokel commented 9 years ago

Thanks for the implementation. But as I mentioned above the alfred socket has also be passed to batadv-vis "-u".