
Example:
memset(&lwreq, 0, sizeof(lwreq));
sprintf(lwreq.ifr_name, "ra0", 3);
lwreq.u.
mode
=
WSC_STOP
;
/* Perform the private ioctl */
if(ioctl(skfd,
RTPRIV_IOCTL_SET_WSC_PROFILE_U32_ITEM
, &lwreq) < 0)
{
fprintf(stderr, "Interface doesn't accept private ioctl...\n");
return -1;
}
5.3.2
iwpriv commands with one INT argument
1.
iwpriv ra0 wsc_cred_count 1
2.
iwpriv ra0 wsc_conn_by_idx 1
3.
iwpriv ra0 wsc_auto_conn 1
4.
iwpriv ra0 wsc_conf_mode 1
5.
iwpriv ra0 wsc_mode 1
6.
iwpriv ra0 wsc_pin 12345678
Example:
memset(&lwreq, 0, sizeof(lwreq));
lwreq.u.data.length = 1;
cred_count = 1;
((int *) buffer)[i] = (int) cred_count;
offset = sizeof(int);
sprintf(lwreq.ifr_name, "ra0", 3);
lwreq.u.
mode
=
WSC_CREDENTIAL_COUNT
;
memcpy(lwreq.u.name + offset, buffer, IFNAMSIZ - offset);
/* Perform the private ioctl */
if(ioctl(skfd,
RTPRIV_IOCTL_SET_WSC_PROFILE_U32_ITEM
, &lwreq) < 0)
{
fprintf(stderr, "Interface doesn't accept private ioctl...\n");
return -1;
}
5.3.3
iwpriv commands with string argume nt
1.
iwpriv ra0 wsc_ssid “0 xxxxx”
2.
iwpriv ra0 wsc_cred_ssid “0 xxxxx”
3.
iwpriv ra0 wsc_cred_auth “0 WPAPSK”
4.
iwpriv ra0 wsc_cred_encr “0 TKIP”
5.
iwpriv ra0 wsc_cred_keyIdx “0 1”
6.
iwpriv ra0 wsc_cred_key “0 12345”
7.
iwpriv ra0 wsc_cred_mac “0 00:11:22:33:44:55”
Example:
memset(&lwreq, 0, sizeof(lwreq));
memset(buffer, 0, 2048);
sprintf(lwreq.ifr_name, "ra0", 3);
sprintf(buffer, "0 wps_ssid_1");
lwreq.u.data.length = strlen(buffer) + 1;
lwreq.u.data.pointer = (caddr_t) buffer;
lwreq.u.data.
flags
=
WSC_CREDENTIAL_SSID
;
32/75