On Wednesday 21 November 2012 14:43:33 liu muye wrote:
This is Muye, I am a university student. Currently, we have a mesh network project using B.A.T.M.A.N.
batmand or batman-adv? I will assume batman-adv in my answer because you mention batctl later.
We are trying to establish wireless communication between each B.A.T.M.A.N client so that they can share information through the mesh network. Specifically, we want to write an application on top of the B.A.T.M.A.N using socket in order to transmit the data packet from one B.A.T.M.A.N client to other B.A.T.M.A.N client. For example, unicast or multicast.
Would you please give us some advices on how to write such application. I have looked at the batctl ping and tcpdump source code, but I was not able to send data packet using the similar mechanism.
batctl ping uses a special trick to inject icmp-like packets. It is nothing which you should do when you want to sent data over batman-adv because it is a debugging thing. batctl tcpdump is just a lightweight tcpdump with some batman-adv specific extras and has nothing to do with the normal data exchange.
We greatly appreciate any of your suggestions.
Just write your application as you would do it normally. batman-adv works transparently for you (when you configured bat0 correctly of course). Therefore: add interfaces to bat0, configure your IPv4/v6 on top of your bat0 device and write your applications using normal sockets for AF_INET or AF_INET6. Of course you can also use raw sockets or any other protocol which runs on top of ethernet.
Kind regards, Sven