Lines Matching defs:env
102 #include "env.h"
513 no_cmds_exec(prop_dictionary_t env, prop_dictionary_t oenv)
519 if ((ifname = getifname(env)) == NULL)
521 else if (getifflags(env, oenv, &ignore) == -1)
524 printall(ifname, env);
529 wait_dad_exec(prop_dictionary_t env, prop_dictionary_t oenv)
593 media_status_exec(prop_dictionary_t env, prop_dictionary_t oenv)
599 if ((ifname = getifname(env)) == NULL)
601 else if (getifflags(env, oenv, &ignore) == -1)
604 exit(carrier(env));
608 do_setifcaps(prop_dictionary_t env)
613 d = (prop_data_t )prop_dictionary_get(env, "ifcaps");
620 if (direct_ioctl(env, SIOCSIFCAP, &ifcr) == -1)
634 prop_dictionary_t env, oenv;
785 env = (nmatch > 0) ? match[(int)nmatch - 1].m_env : NULL;
786 if (env == NULL)
787 env = oenv;
789 env = prop_dictionary_augment(env, oenv);
790 if (env == NULL)
796 process_media_commands(env);
798 if ((af = getaf(env)) == -1)
804 if ((ifname = getifname(env)) == NULL)
811 (*afp->af_addr_commit)(env, oenv);
813 do_setifpreference(env);
814 do_setifcaps(env);
815 do_setethercaps(env);
855 prop_dictionary_t env, oenv;
860 env = prop_dictionary_create();
862 env = prop_dictionary_copy_mutable(env0);
866 if (env == NULL || oenv == NULL)
878 if (!prop_dictionary_set_string(env, "if", ifa->ifa_name))
889 if (sflag && link_state(env) == LINK_STATE_DOWN)
902 status(env, oenv);
906 prop_object_release((prop_object_t)env);
912 list_cloners(prop_dictionary_t env, prop_dictionary_t oenv)
953 clone_command(prop_dictionary_t env, prop_dictionary_t oenv)
957 if (!prop_dictionary_get_int64(env, "clonecmd", &cmd)) {
962 if (indirect_ioctl(env, (unsigned long)cmd, NULL) == -1) {
971 setifaddr(prop_dictionary_t env, prop_dictionary_t oenv)
978 if ((af = getaf(env)) == -1)
981 d = (prop_data_t)prop_dictionary_get(env, "address");
996 setifnetmask(prop_dictionary_t env, prop_dictionary_t oenv)
1000 d = (prop_data_t)prop_dictionary_get(env, "dstormask");
1010 setifbroadaddr(prop_dictionary_t env, prop_dictionary_t oenv)
1015 if (getifflags(env, oenv, &flags) == -1)
1021 d = (prop_data_t)prop_dictionary_get(env, "broadcast");
1032 notrailers(prop_dictionary_t env, prop_dictionary_t oenv)
1040 setifdstormask(prop_dictionary_t env, prop_dictionary_t oenv)
1046 if (getifflags(env, oenv, &flags) == -1)
1049 d = (prop_data_t)prop_dictionary_get(env, "dstormask");
1065 setifflags(prop_dictionary_t env, prop_dictionary_t oenv)
1071 rc = prop_dictionary_get_int64(env, "ifflag", &ifflag);
1074 if (direct_ioctl(env, SIOCGIFFLAGS, &ifr) == -1)
1083 if (direct_ioctl(env, SIOCSIFFLAGS, &ifr) == -1)
1090 getifcaps(prop_dictionary_t env, prop_dictionary_t oenv, struct ifcapreq *oifcr)
1097 capdata = (prop_data_t)prop_dictionary_get(env, "ifcaps");
1105 (void)direct_ioctl(env, SIOCGIFCAP, &ifcr);
1118 setifcaps(prop_dictionary_t env, prop_dictionary_t oenv)
1125 rc = prop_dictionary_get_int64(env, "ifcap", &ifcap);
1128 if (getifcaps(env, oenv, &ifcr) == -1)
1147 setifmetric(prop_dictionary_t env, prop_dictionary_t oenv)
1153 rc = prop_dictionary_get_int64(env, "metric", &metric);
1157 if (direct_ioctl(env, SIOCSIFMETRIC, &ifr) == -1)
1163 do_setifpreference(prop_dictionary_t env)
1171 if (!prop_dictionary_get_int16(env, "preference",
1175 d = (prop_data_t)prop_dictionary_get(env, "address");
1182 if (direct_ioctl(env, SIOCSIFADDRPREF, &ifap) == -1)
1187 setifmtu(prop_dictionary_t env, prop_dictionary_t oenv)
1193 rc = prop_dictionary_get_int64(env, "mtu", &mtu);
1197 if (direct_ioctl(env, SIOCSIFMTU, &ifr) == -1)
1204 link_state(prop_dictionary_t env)
1208 if (direct_ioctl(env, SIOCGIFDATA, &ifdr) == -1)
1231 carrier(prop_dictionary_t env)
1233 switch (link_state(env)) {
1270 status(prop_dictionary_t env, prop_dictionary_t oenv)
1287 if ((af = getaf(env)) == -1) {
1297 if ((ifname = getifinfo(env, oenv, &flags)) == NULL)
1314 if (getifcaps(env, oenv, &ifcr) == -1)
1335 (*status_f->f_func)(env, oenv);
1343 print_link_addresses(env, true);
1365 printf("\tlinkstate: %s\n", link_state_str(link_state(env)));
1367 media_status(env, oenv);
1399 (*statistics_f->f_func)(env);
1404 (*afp->af_status)(env, oenv, true);
1406 (*afp->af_status)(env, oenv, false);
1410 setifprefixlen(prop_dictionary_t env, prop_dictionary_t oenv)
1418 if ((af = getaf(env)) == -1)
1421 rc = prop_dictionary_get_int64(env, "prefixlen", &plen);
1440 setlinkstr(prop_dictionary_t env, prop_dictionary_t oenv)
1447 data = (prop_data_t)prop_dictionary_get(env, "linkstr");
1457 if (getargstr(env, "linkstr", linkstr, linkstrlen) == -1)
1464 if (direct_ioctl(env, SIOCSLINKSTR, &ifdrv) == -1)
1472 unsetlinkstr(prop_dictionary_t env, prop_dictionary_t oenv)
1479 if (direct_ioctl(env, SIOCSLINKSTR, &ifdrv) == -1)
1486 setifdescr(prop_dictionary_t env, prop_dictionary_t oenv)
1493 data = (prop_data_t)prop_dictionary_get(env, "descr");
1506 if (getargstr(env, "descr", descr, len) == -1)
1512 if (direct_ioctl(env, SIOCSIFDESCR, &ifr) != 0)
1521 unsetifdescr(prop_dictionary_t env, prop_dictionary_t oenv)
1527 if (direct_ioctl(env, SIOCSIFDESCR, &ifr) != 0)
1539 prop_dictionary_t env;
1541 if ((env = prop_dictionary_create()) == NULL)
1552 (*usage_f->f_func)(env);
1570 prop_object_release((prop_object_t)env);