====== simple network manager ====== I ([[http://geeks.cl|mnemoc]]) want to reimplement ''rocknet'' in the form of ''snet'' (standing for //"simple network manager"// or if you prefer //"SDE network manager"//). ''snet'' is not supposed to become the only network manager in [[http://opensde.org|OpenSDE]], or to be [[http://opensde.org|OpenSDE]]-specific. It aims to be fully agnostic, and if anyone else beyond myself use it, neat! ;-) Feel free to rummage through the [[http://git.jpi.io/JPI/snet|git repo]]. ===== Rationale ===== The idea is to make it simple for humans, with a single configuration file and with simple modules written in bourne shell syntax to extend the functionality. Powerful enough for //no-so-complex// environments. ===== Syntax ===== As in ''rocknet'' the grammar is very simple, each line is the execution of a //shell function//. command arg1 arg2 arg3 ... The indentation is in practice free, but it recommended to indent by //contexts// using //tab// (just because I hate tight indentation). Comments start with a ''#'' and empty lines are ignored. ===== Commands ===== the first context is global, where the following commands are accepted: *group [ ...] *interface [()] ==== group ==== [[snet-group|group]] declares a list of interfaces to be referenced from //command line// (//CLI//). Nested groups are supported. ====interface==== [[snet-interface|interface]] creates a new context for setting up a given interface, for a given //profile//. If //profile// is not named, "default" is used. This new context has ''$type'' set to ''new'', and ''$profile'' and ''$iface'' are set according to the invocation. ===== CLI: snet ===== snet [-p ] [-f ] [] If //profile// is not given, ''snet-getprofile'' will be called (when available) and the single token returned as output is used. If it's empty, //default// is used. If //rulesfile// is not given, the default file is used (''/etc/conf/network''). If //interface// is not given, the //auto// group is used. It can be a [[snet-group|group]] or an actual [[snet-interface|interface]]. The accepted actions are: * ''up'', to start the //interface// from scratchs. * ''down'', to stop the //interface// to ground. * ''reload'', to flush the //firewall// rules and apply the new ones, without setting the //interface// down. * ''compile'', just compile the new rules file ===== CLI: snetc ===== snetc [-f ] ''snetc'' turns a //rules file// into a directory structure easy for ''snet'' procedures, and easy for human review. ''snetc'' is called internally by snet if the file has been updated or not compiled before. ===== CLI: snet-getprofile ===== snet-getprofile ''snet-getprofile'' is supposed to return one word, the name of the ''profile'' to use for this interface in this instant. "default" is used of this tool is not found in the ''$PATH'' or if it doesn't return anything. ===== Layout ===== ''snet'' will read by default it's rules from ''/etc/conf/network''. the modules are ''/lib/snet/modules/*.in'' and temporal files and records are kept in ''/var/run/snet/''. ===== Source ===== Browse the source at [[http://git.jpi.io/JPI/snet]]