On 2013-08-01 3:17 PM, Pietro Paolini wrote: > Hello all, > > I had a look to the /etc/init.d/network script and I would like > understand the details of its implementation, especially regarding > the reload() function; I have to say in advance that I don't have a > big experience of ubus and netifd - maybe should be better say that I > know nothing about that - and I don't know where to find some > documentation about them, do you have some useful link ? There's no real documentation on the internals, you should read the source code.
> As I understand from the OpenWRT related web page > > http://wiki.openwrt.org/doc/techref/ubus > http://wiki.openwrt.org/doc/techref/netifd > > the ubusd is a daemon which listen for calls and when received it > calls a function registered with some argument, as I can see from > > root@uplink:~# ubus -v list network.interface.lan > 'network.interface.lan' @099f0c8b "up": { } "add_device": { "name": > "String" } "remove_device": { "name": "String" } > > the "up" function does not take any parameters and the add_device > does, am I right ? Right. > In the netifd page is reported that: > > ...Simply run /etc/init.d/network reload. This will issue an > ubus-call to netifd, telling it to figure out the difference between > runtime state and the new config and apply only that. This works on a > per-interface level, even with protocol handlers written as shell > scripts… > > But which function is called ? Where can I see the code of this > function and where and how the changes are tracked by netifd ? http://nbd.name/gitweb.cgi?p=luci2/netifd.git;a=blob;f=ubus.c Here you can find the code that registers the ubus objects, and the method implementations. You can find the code that interacts with the config here: http://nbd.name/gitweb.cgi?p=luci2/netifd.git;a=blob;f=config.c - Felix _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
