Beispiel #1
0
/* this is the routine you should call whenever you would normally
 * read a keypress. However, to actually tell if a key is pressed,
 * call is_key_pressed() with a scancode as arg.
 */
static int scan_keyboard(void)
{
    int c, key, flag;

/* we use BFI to fix the PrtSc/Pause problem - i.e. we don't :^) */
    while ((c = get_scancode()) == 0xE0);
    if (c == 0xE1)
	c = get_scancode();

    if (c == -1)
	return -1;		/* no key was pressed */

    key = c & 127;
    flag = (c & 128) ? 0 : 1;	/* 1 = down */

    if (flag || key_down[key] != flag)
      key_down[key] = flag;
    else
      return (scan_keyboard ());

    if (key == LEFT_ALT)
	alt_pressed = flag;

    if (alt_pressed && flag && key >= FUNC_KEY(1) && key <= FUNC_KEY(10)) {
	struct vt_stat vts;
	int newvt;

	ioctl(tty_fd, VT_GETSTATE, &vts);
	newvt = c - FUNC_KEY(1) + 1;
	if (vts.v_active != newvt && vtswitch_allowed) {
	    ioctl(tty_fd, VT_ACTIVATE, newvt);
	    restart_con = 0;
	    while (restart_con == 0)
		usleep(50000);
	}
	return -1;		/* Got VT switch */
    }
    if (flag && key == 46 && key_down[LEFT_CTRL])
	raise(SIGINT);
    return key;			/* No VT switch */
}
Beispiel #2
0
 *
 * For each configuration line in wpa_supplicant.conf, the parser goes through
 * this table and select the entry that matches with the field name. The parser
 * function (.parser) is then called to parse the actual value of the field.
 *
 * This kind of mechanism makes it easy to add new configuration parameters,
 * since only one line needs to be added into this table and into the
 * struct wpa_ssid definition if the new variable is either a string or
 * integer. More complex types will need to use their own parser and writer
 * functions.
 */
static const struct parse_data ssid_fields[] = {
	{ STR_RANGE(ssid, 0, MAX_SSID_LEN) },
	{ INT_RANGE(scan_ssid, 0, 1) },
	{ FUNC(bssid) },
	{ FUNC_KEY(psk) },
	{ FUNC(proto) },
	{ FUNC(key_mgmt) },
	{ FUNC(pairwise) },
	{ FUNC(group) },
	{ FUNC(auth_alg) },
#ifdef IEEE8021X_EAPOL
	{ FUNC(eap) },
	{ STR_LENe(identity) },
	{ STR_LENe(anonymous_identity) },
	{ FUNC_KEY(password) },
	{ STRe(ca_cert) },
	{ STRe(ca_path) },
	{ STRe(client_cert) },
	{ STRe(private_key) },
	{ STR_KEYe(private_key_passwd) },
Beispiel #3
0
	{ INT_RANGE(nspid, 0, 0xffffff) },
	{ INT_RANGE(use_pkm, 0, 1) },
	{ INT_RANGE(use_nv, 0, 1) },
	{ INT_RANGE(eap_type, -1, 7) },	
	{ INT_RANGE(ca_cert_null, 0, 1) },	
	{ INT_RANGE(dev_cert_null, 0, 1) },	
	{ INT_RANGE(cert_nv, 0, 1) },	
	{ INT_RANGE(wimax_verbose_level, -1, 3) },	
	{ INT_RANGE(wpa_debug_level, 0, 4) },
	{ STR(log_file) },
	{ STR(event_script) },
	{ FUNC(eap) },
	{ STR_LEN(identity) },
	{ STR_LEN(anonymous_identity) },
	{ FUNC_KEY(password) },
	{ STR(ca_cert) },
	{ STR(client_cert) },
	{ STR(private_key) },	
	{ STR_KEY(private_key_passwd) },
	{ STR(phase1) },
	{ STR(phase2) },
};

#undef OFFSET
#undef _STR
#undef STR
#undef STR_KEY
#undef _STR_LEN
#undef STR_LEN
#undef _INT