int getaf(prop_dictionary_t env) { int64_t af; if (!prop_dictionary_get_int64(env, "af", &af)) { errno = ENOENT; return -1; } return (int)af; }
static int setifpowersavesleep(prop_dictionary_t env, prop_dictionary_t oenv) { struct ieee80211_power power; int64_t maxsleep; bool rc; rc = prop_dictionary_get_int64(env, "powersavesleep", &maxsleep); assert(rc); if (direct_ioctl(env, SIOCG80211POWER, &power) == -1) err(EXIT_FAILURE, "SIOCG80211POWER"); power.i_maxsleep = maxsleep; if (direct_ioctl(env, SIOCS80211POWER, &power) == -1) err(EXIT_FAILURE, "SIOCS80211POWER"); return 0; }
/* ARGSUSED */ static int setcarp_state(prop_dictionary_t env, prop_dictionary_t oenv) { struct carpreq carpr; int64_t carp_state; if (!prop_dictionary_get_int64(env, "carp_state", &carp_state)) { errno = ENOENT; return -1; } carp_get(env, &carpr); carpr.carpr_state = carp_state; carp_set(env, &carpr); return 0; }
/* ARGSUSED */ int setcarp_advbase(prop_dictionary_t env, prop_dictionary_t oenv) { struct carpreq carpr; int64_t advbase; if (!prop_dictionary_get_int64(env, "advbase", &advbase)) { errno = ENOENT; return -1; } carp_get(env, &carpr); carpr.carpr_advbase = advbase; carp_set(env, &carpr); return 0; }
int setcarp_vhid(prop_dictionary_t env, prop_dictionary_t oenv) { struct carpreq carpr; int64_t vhid; if (!prop_dictionary_get_int64(env, "vhid", &vhid)) { errno = ENOENT; return -1; } carp_get(env, &carpr); carpr.carpr_vhid = vhid; carp_set(env, &carpr); return 0; }