Lines Matching defs:n

170 static void safe_snprintf(char *s, size_t n,
505 (void) fprintf(stderr, "%s\n", buf);
515 (void) fprintf(stderr, gettext("%s: malloc: %s\n"),
529 (void) fprintf(stderr, gettext("%s: calloc: %s\n"),
543 (void) fprintf(stderr, gettext("%s: strdup: %s\n"),
551 safe_snprintf(char *s, size_t n, const char *format, ...)
557 len = vsnprintf(s, n, format, ap);
558 if ((len <= 0) || (len > n - 1)) {
560 gettext("%s: snprintf: %s\n"),
574 (void) fprintf(stderr, gettext("%s: fclose: %s\n"),
587 PRTDBG(("new_ae(0x%x, \"%s\")\n", ael, arg));
616 PRTDBG(("new_ael(%d) = 0x%x\n", type, plist));
633 PRTDBG(("new_config_file() = 0x%x\n", p_config_file));
647 PRTDBG(("new_section(0x%x, 0x%x, \"%s\")\n", p_config_file, p_list,
676 PRTDBG(("destory_config(0x%x)\n", p_config_file));
796 "\n"), gExecName, pfile);
806 if ((buf_line[0] == '\n') || (buf_line[0] == ' '))
808 /* replace the old '\n' to '\0' */
818 "%s : duplicated %s section\n"),
830 "%s : duplicated %s section\n"),
842 "%s : duplicated %s section\n"),
875 gettext("%s: %s: file format error\n"),
881 PRTDBG(("parse_file(\"%s\")=0x%x\n", pfile, p_config_file));
900 PRTDBG(("aeltoargv(%x)\n", ael));
915 PRTDBG(("aeltoargv(0x%x) = 0x%x\n\n", ael, argv));
935 PRTDBG(("fprint_config_file(0x%x, \"%s\")\n", p_config_file,
943 (void) fprintf(stderr, gettext("%s: failed to open %s\n"),
953 PRTDBG(("fprint_config_file: section_id=%s\n",
955 len = fprintf(file, "\n%s\n", p_section->section_id);
958 "failed to update %s: %s\n"),
966 len = fprintf(file, "%s\n",
971 "update %s: %s\n"),
994 "file %s stat: %s\n"),
1001 "\n"), gExecName, file_name, strerror(errno));
1023 PRTDBG(("append_pa(\"%s\") = \"%s\"\n", arg, pbuf));
1035 PRTDBG(("find_section(0x%x, \"%s\")\n", p_config_file, section_id));
1062 PRTDBG(("get_value(\"%s\") = \"%s\"\n", arg, p + 1));
1080 PRTDBG(("search interface\n"));
1089 PRTDBG(("failed to open '/dev/wifi'\n"));
1103 PRTDBG(("interface %s doesn't exist\n", dp->d_name));
1106 PRTDBG(("interface %s is the first found interface\n",
1115 PRTDBG(("failed to find available wireless interface\n"));
1133 PRTDBG(("open_dev(\"%s\")\n", devname));
1153 "\n"), gExecName, devname, strerror(errno));
1158 "not a stream device\n"),
1173 PRTDBG(("call_ioctl_gs(%d, 0x%x, 0x%x, 0x%x)\n",
1191 "unsupported ioctl command\n"), gExecName);
1230 PRTDBG(("del_prefer(0x%x, \"%s\")\n", p_config_file, prefer));
1268 "no such profile: '%s' in the preference list\n"),
1290 PRTDBG(("del_section(0x%x, \"%s\")\n", p_config_file, section_id));
1291 PRTDBG(("del_section: %d section(s) in config file\n",
1359 PRTDBG(("set_prefer(0x%x, \"%s\", %d)\n", p_config_file, prefer, rank));
1364 "no such profile: '%s'\n"),
1406 PRTDBG(("set_prefer: %d Profiles in prefer list\n", plist->ael_argc));
1441 PRTDBG(("set_prefer: %d Profiles in prefer list\n", plist->ael_argc));
1458 PRTDBG(("add_to_history(0x%x, %d, 0x%x)\n", p_config_file, argc, argv));
1526 " autoconf [wait={n|forever}]\n"), gExecName);
1528 " connect profile [wait={n|forever}]\n"), gExecName);
1530 " connect essid [wait={n|forever}]\n"), gExecName);
1532 " disconnect\n"), gExecName);
1534 " getparam [parameter [...]]\n"), gExecName);
1536 " setparam [parameter=value [...]]\n"), gExecName);
1538 "\tparameters:\n"
1540 "base station\n"
1542 "to 32 chars\n"
1544 " or auto\n"
1545 "\t\tcreateibss\t - flag to identify whether a ibss is to be\n"
1546 "\t\t\t\t created when the network to connect is\n"
1547 "\t\t\t\t not available, yes or no\n"
1548 "\t\tchannel\t\t - channel(used only when creating an ibss)\n"
1549 "\t\t\t\t valid value:\n"
1550 "\t\t\t\t\t 802.11a: 0-99\n"
1551 "\t\t\t\t\t 802.11b: 1-14\n"
1552 "\t\t\t\t\t 802.11g: 1-14\n"
1553 "\t\trates\t\t - set of rates, seperated by ',' valid rates:\n"
1554 "\t\t\t\t 1,2,5.5,6,9,11,12,18,22,24,33,36,48 and 54\n"
1555 "\t\tpowermode\t - off, mps or fast\n"
1556 "\t\tauthmode\t - opensystem or shared_key\n"
1557 "\t\tencryption\t - none or wep\n"
1558 "\t\twepkey|1-4\t - write only:\n"
1559 "\t\t\t\t 5 chars or 10 hex digits for 40bit wepkey;\n"
1560 "\t\t\t\t 13 chars or 26 hex digits for 128bit wepkey\n"
1561 "\t\twepkeyindex\t - an integer within the range 1-4\n"
1562 "\t\tsignal\t\t - read only: signal strength from 0 to 15\n"
1563 "\t\tradio\t\t - on or off\n"));
1565 " restoredef\n"), gExecName);
1567 " scan\n"), gExecName);
1569 " showstatus\n"), gExecName);
1571 " setwepkey 1|2|3|4\n"), gExecName);
1573 (void) fprintf(stderr, "\n");
1576 " createprofile profile parameter=value [...]\n"), gExecName);
1578 " deleteprofile profile1 [profile2 [...]]\n"), gExecName);
1580 " showprofile profile1 [profile2 [...]]\n"), gExecName);
1582 " setprofilewepkey profile 1|2|3|4\n"), gExecName);
1584 " getprofileparam profile [parameter [...]]\n"), gExecName);
1586 " setprofileparam profile [parameter=value [...]]\n"), gExecName);
1588 (void) fprintf(stderr, "\n");
1591 " history\n"), gExecName);
1593 " listprefer\n"), gExecName);
1595 " removeprefer profile\n"), gExecName);
1597 " setprefer profile [n]\n"), gExecName);
1606 int i = 0, n = 0;
1608 PRTDBG(("do_print_support_params(\"%d\")\n", fd));
1611 (void) printf(gettext("\t parameter\tproperty\n"));
1621 (void) printf(gettext("\tread only\n"));
1623 (void) printf(gettext("\tread/write\n"));
1624 n++;
1628 return (n ? B_TRUE : B_FALSE);
1639 PRTDBG(("check_authority()\n"));
1648 "wepkey.\n"), gExecName, WIFI_WEP_AUTH);
1651 "privilege '%s' is required.\n"),
1693 PRTDBG(("essid_of_profile: profile = %s\n", profile));
1706 PRTDBG(("essid_of_profile: essid = %s\n",
1733 PRTDBG(("heuristic_load: enter\n"));
1764 PRTDBG(("heuristic_load: %s is selected\n",
1775 " failed to connect to any essid\n"),
1781 (void) printf(gettext("%s: autoconf: essid '%s' is selected%s\n"),
1793 "essid '%s'\n"), gExecName, essid);
1800 "essid '%s'\n"), gExecName, essid);
1831 "autoconf : failed to scan\n"), gExecName);
1943 PRTDBG(("do_autoconf(%d, 0x%x)\n", argc, argv));
1963 "invalid value %s for 'wait'\n"),
1979 "useless tokens after '%s'\n"),
1995 " is selected\n"), gExecName, selected);
2030 PRTDBG(("do_startconf(%d, 0x%x)\n", argc, argv));
2080 PRTDBG(("find_active_profile: %d\n", fd));
2175 PRTDBG(("do_loadpf(%d, %x)\n", argc, argv));
2179 "profile name missing\n"), gExecName);
2200 "invalid value %s for 'wait'\n"),
2216 "useless tokens after '%s'\n"),
2304 "%s '%s'\n"), gExecName, connect, argv[0]);
2309 PRTDBG(("connect counting:......%d\n", timeout));
2312 "%s '%s'\n"), gExecName, connect, argv[0]);
2318 * if wepkey is set in the profile, display wepkey|n=*****
2344 (void) printf("\t%s=*****\n",
2349 (void) printf("\t%s=*****\n", param);
2372 PRTDBG(("do_printpf(%d, %x)\n", argc, argv));
2382 (void) printf("%s\n", p_section->section_id);
2386 (void) printf("\t%s\n",
2407 (void) printf("%s\n", p_section->section_id);
2413 (void) printf("\t%s\n",
2427 "no such profile: '%s'\n"),
2445 PRTDBG(("find_ae: arg= NULL or plist=NULL\n"));
2448 PRTDBG(("find_ae(0x%x, \"%s\")\n", plist, arg));
2454 PRTDBG(("find_ae: param = \"%s\"\n", param));
2463 PRTDBG(("find_ae: param = \"%s\"\n", param));
2484 PRTDBG(("update_aelist(0x%x, \"%s\")\n", plist, arg));
2507 PRTDBG(("do_deletepf(%d, \"%s\")\n", argc, argv));
2554 ": no such profile: '%s'\n"),
2585 PRTDBG(("do_history(%d, 0x%x)\n", argc, argv));
2588 "after 'history'\n"), gExecName);
2592 PRTDBG(("no history section\n"));
2615 "data format error\n"),
2635 gettext("bssid\t\t encryption\tlast seen\n"));
2639 "\tlast seen\n"));
2697 PRTDBG(("do_lsprefer(%d, 0x%x)\n", argc, argv));
2700 "after 'listprefer'\n"), gExecName);
2711 (void) printf("%d\t%s\n", ++i, pbuf);
2718 PRTDBG(("no preference section\n"));
2735 PRTDBG(("do_rmprefer(%d, 0x%x)\n", argc, argv));
2798 PRTDBG(("do_setprefer(%d, 0x%x)\n", argc, argv));
2808 "should be an integer within 1-10\n"), gExecName);
2882 "wepkey should be:\n"
2883 "\t 40bits: 5 char or 10 hex digits.\n"
2884 "\t 128bits: 13 char or 26 hex digits.\n"),
2902 PRTDBG(("get_valid_wepkey()\n"));
2918 while (((buf[i++] = getchar()) != '\n') && (i < MAX_KEY_LENGTH + 1)) {
2921 (void) putchar('\n');
2926 if (buf[--i] != '\n') {
2928 "exceeds 26 hex digits\n"), gExecName);
2932 /* Replace last char '\n' with '\0' */
2954 PRTDBG(("do_set_wepkey(%d, \"%s\")\n", fd, pbuf));
2976 PRTDBG(("do_set_wepkey: error pbuf size\n"));
2978 "wepkey should be:\n"
2979 "\t 40bits: 5 char or 10 hex digits.\n"
2980 "\t 128bits: 13 char or 26 hex digits.\n"),
2996 "should be an integer within the range 1-4\n"), gExecName);
3020 "should be an integer within the range 1-4\n"), gExecName);
3039 "two inputs are not identical\n"), gExecName);
3044 len = MAX_KEY_LENGTH + strlen("wepkey1=\n") + 1;
3063 PRTDBG(("do_wepkey(%d, 0x%x)\n", argc, argv));
3071 "after 'setwepkey'\n"), gExecName);
3091 PRTDBG(("do_setprofwepkey(%d, 0x%x)\n", argc, argv));
3098 "after 'setprofwepkey'\n"), gExecName);
3106 "no such profile: '%s'\n"),
3129 PRTDBG(("do_wlanlist(%d, 0x%x)\n", argc, argv));
3133 "after 'scan'\n"), gExecName);
3136 (void) fprintf(stderr, gettext("%s: failed to scan\n"),
3157 PRTDBG(("do_showstatus(%d, 0x%x)\n", argc, argv));
3162 "after 'showstatus'\n"), gExecName);
3171 (void) printf("\tactive profile: %s\n",
3185 (void) printf("\tsignal strength: weak(%d)\n",
3188 (void) printf("\tsignal strength: medium(%d)\n",
3191 (void) printf("\tsignal strength: strong(%d)\n",
3207 PRTDBG(("do_restoredef(%d, 0x%x)\n", argc, argv));
3212 "after 'restoredef'\n"), gExecName);
3229 PRTDBG(("do_disconnect(%d, 0x%x)\n", argc, argv));
3234 "after 'disconnect'\n"), gExecName);
3249 PRTDBG(("do_set_essid(%d, \"%s\")\n", fd, arg));
3266 "essid exceeds 32 bytes\n"), gExecName);
3282 PRTDBG(("do_set_bsstype(%d, \"%s\")\n", fd, arg));
3297 "bss(ap,infrastructure) ibss(ad-hoc) or auto\n"),
3314 PRTDBG(("do_set_createibss(%d, \"%s\")\n", fd, arg));
3324 "createibss: yes or no\n"), gExecName);
3340 PRTDBG(("do_set_channel(%d, \"%s\")\n", fd, arg));
3346 "should be:\n"
3347 "\t802.11a: 0-99\n"
3348 "\t802.11b: 1-14\n"
3349 "\t802.11g: 1-14\n"), gExecName);
3353 PRTDBG(("channel=%d\n", phy_conf.wl_phy_dsss_conf.wl_dsss_channel));
3370 PRTDBG(("is_rates_support(%d, %d, 0x%x)\n", fd, num, rates));
3377 PRTDBG(("rates[%d] = %d\n", i, rates[i]));
3381 PRTDBG(("supported rates[%d]=%d\n", j, value));
3390 "rate 5.5M is not supported\n"),
3395 "rate %dM is not supported\n"),
3423 "invalid rates '%s'\n"), gExecName, rates);
3450 PRTDBG(("get_rates: empty rates string\n"));
3453 PRTDBG(("get_rates(\"%s\", 0x%x)\n", arg, len));
3465 PRTDBG(("rates[0]: %s\n", token));
3469 PRTDBG(("rates[%d]: %s\n", i, token));
3478 gettext("%s: rates duplicated\n"),
3497 PRTDBG(("do_set_rates(%d, \"%s\")\n", fd, arg));
3523 PRTDBG(("do_set_powermode(%d, \"%s\")\n", fd, arg));
3548 gettext("%s: powermode: off mps or fast\n"), gExecName);
3563 PRTDBG(("do_set_authmode(%d, \"%s\")\n", fd, arg));
3574 "opensystem or shared_key\n"), gExecName);
3589 PRTDBG(("do_set_encryption(%d, \"%s\")\n", fd, arg));
3599 "none or wep\n"), gExecName);
3614 PRTDBG(("do_set_wepkeyid(%d, \"%s\")\n", fd, arg));
3619 "should be an integer within the range 1-4\n"), gExecName);
3635 PRTDBG(("do_set_radioon(%d, \"%s\")\n", fd, arg));
3645 gettext("%s: radio : on or off\n"), gExecName);
3679 PRTDBG(("print_gbuf(%d)\n", index));
3688 (void) printf("none\n");
3694 (void) printf("none\n");
3699 (void) printf("%02x\n", ((uint8_t *)gbuf->wldp_buf)[i]);
3702 (void) printf("\tessid: %s\n", ((wl_essid_t *)(gbuf->wldp_buf))
3709 (void) printf("\tbsstype: bss(ap, infrastructure)\n");
3712 (void) printf("\tbsstype: ibss(ad-hoc)\n");
3715 (void) printf("\tbsstype: auto\n");
3720 "invalid bsstype value\n"), gExecName);
3727 (void) printf("\tcreateibss: yes\n");
3730 (void) printf("\tcreateibss: no\n");
3735 "invalid createibss value\n"), gExecName);
3746 (void) printf("\tchannel: %d\n", ((wl_fhss_t *)
3750 (void) printf("\tchannel: %d\n", ((wl_ofdm_t *)
3756 "invalid subtype\n"), gExecName);
3773 (void) printf("\n");
3782 (void) printf("\tpowermode: off\n");
3785 (void) printf("\tpowermode: mps\n");
3788 (void) printf("\tpowermode: fast\n");
3793 "invalid powermode value\n"), gExecName);
3801 (void) printf("\tauthmode: opensystem\n");
3804 (void) printf("\tauthmode: shared_key\n");
3809 "invalid authmode value\n"), gExecName);
3817 (void) printf("\tencryption: none\n");
3820 (void) printf("\tencryption: wep\n");
3825 "invalid encryption value\n"), gExecName);
3831 (void) printf("\twepkeyindex: %d\n", wepkeyid + 1);
3835 (void) printf("\tsignal: %d\n", signal);
3841 (void) printf("\tradio: on\n");
3844 (void) printf("\tradio: off\n");
3849 "invalid radioon value\n"), gExecName);
3856 (void) printf("\tlinkstatus: connected\n");
3859 (void) printf("\tlinkstatus: not connected\n");
3864 "invalid linkstatus value\n"), gExecName);
3892 gettext("bssid\t\t type\t\tencryption\tsignallevel\n"));
3896 "encryption\tsignallevel\n");
3940 (void) printf("\t%d\n", p_ess_conf[i]->wl_ess_conf_sl);
3951 "invalid parameter type\n"), gExecName);
3962 PRTDBG(("do_get_bssid(%d)\n", fd));
3969 PRTDBG(("do_get_essid(%d)\n", fd));
3976 PRTDBG(("do_get_bsstype(%d)\n", fd));
3983 PRTDBG(("do_get_createibss(%d)\n", fd));
3990 PRTDBG(("do_get_channel(%d)\n", fd));
3997 PRTDBG(("do_get_wlanlist(%d)\n", fd));
4004 PRTDBG(("do_get_linkstauts(%d)\n", fd));
4011 PRTDBG(("do_get_rates(%d)\n", fd));
4018 PRTDBG(("do_get_powermode(%d)\n", fd));
4025 PRTDBG(("do_get_authmode(%d)\n", fd));
4032 PRTDBG(("do_get_encryption(%d)\n", fd));
4039 PRTDBG(("do_get_wepkeyid(%d)\n", fd));
4045 PRTDBG(("do_get_signal(%d)\n", fd));
4052 PRTDBG(("do_get_radioon(%d)\n", fd));
4097 "'wepkey'\n"), gExecName, wepkey);
4108 "parameter=value'\n"),
4122 "unrecognized parameter '%s'\n"),
4130 "invalid value '%s' for parameter '%s'\n"),
4153 PRTDBG(("do_createprofile(%d, 0x%x)\n", argc, argv));
4176 "essid required when creating profile\n"),
4184 "non-empty essid required\n"),
4200 "'%s' is an invalid profile name\n"),
4206 PRTDBG(("do_createprofile: profile_name = %s\n", pbuf));
4211 "profile '%s' already exists\n"),
4241 PRTDBG(("do_setprofparam(%d, 0x%x)\n", argc, argv));
4252 "profile '%s' doesn't exist\n"),
4281 PRTDBG(("do_getprofparam(%d, 0x%x)\n", argc, argv));
4290 "profile '%s' doesn't exist\n"),
4307 (void) printf("\t%s\n", pae->ae_arg);
4336 "%s\n"), argv[i]);
4346 (void) printf("\t%s\n", pae->ae_arg);
4353 "parameter '%s' has not been set in profile %s\n"),
4472 PRTDBG(("do_set(%d, 0x%x)\n", argc, argv));
4498 "'%s', use 'parameter=value'\n"),
4504 PRTDBG(("do_set: param = \"%s\", value = \"%s\"\n",
4521 "%s\n"), gExecName, param);
4529 gettext("%s: parameter '%s' is read-only\n"),
4559 int i = 0, j = 0, n = 0;
4562 PRTDBG(("do_get(%d, 0x%x)\n", argc, argv));
4573 n++;
4576 ret = n ? B_TRUE:B_FALSE;
4595 "%s\n"), argv[i]);
4601 gettext("%s: parameter '%s' is write-only\n"),
4636 " '"WIFI_LOCKF"': %s\n"), gExecName, strerror(errno));
4655 "by 'process %d'\n"), gExecName, lock.l_pid);
4673 " exit_filelock: %s\n"),
4696 PRTDBG(("main(%d, 0x%x)\n", argc, argv));
4697 PRTDBG(("uid=%d\n", getuid()));
4698 PRTDBG(("euid=%d\n", geteuid()));
4702 (void) printf("Press RETURN to continue...\n");
4716 PRTDBG(("main: priviledge init error\n"));
4718 "set priviledge to 'basic' error\n"),
4727 "set permitted priviledge: %s\n"),
4734 "set limit priviledge: %s\n"),
4741 "set inherit priviledge: %s\n"),
4748 "set effective priviledge: %s\n"),
4756 PRTDBG(("%d\t\t\"%s\"\n", i, argv[i]));
4827 "subcommand: %s\n"), gExecName, argv[0]);
4842 "wifi interface\n"), gExecName);
4903 PRTDBG(("Command %s failed\n", argv[0]));