#include "af_inetany.h" #define DEFNSELLEN 1 static void iso_constructor(void) __attribute__((constructor)); static int setnsellength(prop_dictionary_t, prop_dictionary_t); static void iso_status(prop_dictionary_t, prop_dictionary_t, bool); static void iso_commit_address(prop_dictionary_t, prop_dictionary_t); static struct afswtch isoaf = { .af_name = "iso", .af_af = AF_ISO, .af_status = iso_status, .af_addr_commit = iso_commit_address }; struct pinteger parse_snpaoffset = PINTEGER_INITIALIZER1(&snpaoffset, "snpaoffset", INT_MIN, INT_MAX, 10, NULL, "snpaoffset", &command_root.pb_parser); struct pinteger parse_nsellength = PINTEGER_INITIALIZER1(&nsellength, "nsellength", 0, UINT8_MAX, 10, setnsellength, "nsellength", &command_root.pb_parser); static const struct kwinst isokw[] = { {.k_word = "nsellength", .k_nextparser = &parse_nsellength.pi_parser} , {.k_word = "snpaoffset", .k_nextparser = &parse_snpaoffset.pi_parser} }; struct pkw iso = PKW_INITIALIZER(&iso, "ISO", NULL, NULL, isokw, __arraycount(isokw), NULL); static cmdloop_branch_t branch;
static int setcarp_advbase(prop_dictionary_t, prop_dictionary_t); static int setcarp_advskew(prop_dictionary_t, prop_dictionary_t); static int setcarp_passwd(prop_dictionary_t, prop_dictionary_t); static int setcarp_vhid(prop_dictionary_t, prop_dictionary_t); static int setcarp_state(prop_dictionary_t, prop_dictionary_t); static int setcarpdev(prop_dictionary_t, prop_dictionary_t); static const char *carp_states[] = { CARP_STATES }; struct kwinst carpstatekw[] = { {.k_word = "INIT", .k_nextparser = &command_root.pb_parser} , {.k_word = "BACKUP", .k_nextparser = &command_root.pb_parser} , {.k_word = "MASTER", .k_nextparser = &command_root.pb_parser} }; struct pinteger parse_advbase = PINTEGER_INITIALIZER1(&parse_advbase, "advbase", 0, 255, 10, setcarp_advbase, "advbase", &command_root.pb_parser); struct pinteger parse_advskew = PINTEGER_INITIALIZER1(&parse_advskew, "advskew", 0, 254, 10, setcarp_advskew, "advskew", &command_root.pb_parser); struct piface carpdev = PIFACE_INITIALIZER(&carpdev, "carpdev", setcarpdev, "carpdev", &command_root.pb_parser); struct pkw carpstate = PKW_INITIALIZER(&carpstate, "carp state", setcarp_state, "carp_state", carpstatekw, __arraycount(carpstatekw), &command_root.pb_parser); struct pstr pass = PSTR_INITIALIZER(&pass, "pass", setcarp_passwd, "pass", &command_root.pb_parser); struct pinteger parse_vhid = PINTEGER_INITIALIZER1(&vhid, "vhid",
, {.k_word = "-rts", .k_key = "rts", .k_type = KW_T_INT, .k_int = IEEE80211_RTS_MAX, .k_exec = setifrts, .k_nextparser = &command_root.pb_parser} , {.k_word = "ssid", .k_nextparser = &parse_ssid.ps_parser} , {.k_word = "powersavesleep", .k_nextparser = &parse_powersavesleep.pi_parser} }; struct pkw kw80211 = PKW_INITIALIZER(&kw80211, "802.11 keywords", NULL, NULL, kw80211kw, __arraycount(kw80211kw), NULL); struct pkw ieee80211bool = PKW_INITIALIZER(&ieee80211bool, "ieee80211 boolean", NULL, NULL, ieee80211boolkw, __arraycount(ieee80211boolkw), &command_root.pb_parser); struct pinteger parse_chan = PINTEGER_INITIALIZER1(&parse_chan, "chan", 0, UINT16_MAX, 10, setifchan, "chan", &command_root.pb_parser); struct pinteger parse_rts = PINTEGER_INITIALIZER1(&parse_rts, "rts", IEEE80211_RTS_MIN, IEEE80211_RTS_MAX, 10, setifrts, "rts", &command_root.pb_parser); struct pinteger parse_frag = PINTEGER_INITIALIZER1(&parse_frag, "frag", IEEE80211_FRAG_MIN, IEEE80211_FRAG_MAX, 10, setiffrag, "frag", &command_root.pb_parser); struct pstr parse_ssid = PSTR_INITIALIZER(&parse_pass, "ssid", setifssid, "ssid", &command_root.pb_parser); struct pinteger parse_powersavesleep = PINTEGER_INITIALIZER1(&parse_powersavesleep, "powersavesleep", 0, INT_MAX, 10, setifpowersavesleep, "powersavesleep",
#include "extern.h" #ifndef satocsat #define satocsat(__sa) ((const struct sockaddr_at *)(__sa)) #endif static void at_status(prop_dictionary_t, prop_dictionary_t, bool); static void at_commit_address(prop_dictionary_t, prop_dictionary_t); static void at_constructor(void) __attribute__((constructor)); static struct afswtch ataf = { .af_name = "atalk", .af_af = AF_APPLETALK, .af_status = at_status, .af_addr_commit = at_commit_address }; struct pinteger phase = PINTEGER_INITIALIZER1(&phase, "phase", 1, 2, 10, NULL, "phase", &command_root.pb_parser); struct pstr parse_range = PSTR_INITIALIZER(&range, "range", NULL, "range", &command_root.pb_parser); static const struct kwinst atalkkw[] = { {.k_word = "phase", .k_nextparser = &phase.pi_parser} , {.k_word = "range", .k_nextparser = &parse_range.ps_parser} }; struct pkw atalk = PKW_INITIALIZER(&atalk, "AppleTalk", NULL, NULL, atalkkw, __arraycount(atalkkw), NULL); static cmdloop_branch_t branch; static void