/* Extract TOS field from IP header (IPv4 and IPv6 differ) */
switch(pkt->data[0] >> 4) {
- case 4:
- tos = pkt->data[1];
- break;
- case 6:
- tos = (load_be16(pkt->data) >> 4) & 0xff;
- break;
- default:
- vpn_progress(vpninfo, PRG_ERR,
- _("Unknown packet (len %d) received: %02x %02x %02x %02x...\n"),
- pkt->len, pkt->data[0], pkt->data[1], pkt->data[2], pkt->data[3]);
- return -EINVAL;
+ case 4:
+ tos = pkt->data[1];
+ break;
+ case 6:
+ tos = (load_be16(pkt->data) >> 4) & 0xff;
+ break;
+ default:
+ vpn_progress(vpninfo, PRG_ERR,
+ _("Unknown packet (len %d) received: %02x %02x %02x %02x...\n"),
+ pkt->len, pkt->data[0], pkt->data[1], pkt->data[2], pkt->data[3]);
+ return -EINVAL;
}
/* set the actual value */
print_depth_shift(buf, depth);
}
switch (value->type) {
- case json_none:
- default:
- buf_append(buf, "none\n");
- break;
- case json_object:
- dump_json_object(vpninfo, lvl, buf, value, depth+1);
- return;
- case json_array:
- dump_json_array(vpninfo, lvl, buf, value, depth+1);
- return;
- case json_integer:
- buf_append(buf, "int: %10" PRId64 "\n", value->u.integer);
- break;
- case json_double:
- buf_append(buf, "double: %f\n", value->u.dbl);
- break;
- case json_string:
- buf_append(buf, "string: %s\n", value->u.string.ptr);
- break;
- case json_boolean:
- buf_append(buf, "bool: %d\n", value->u.boolean);
- break;
+ case json_none:
+ default:
+ buf_append(buf, "none\n");
+ break;
+ case json_object:
+ dump_json_object(vpninfo, lvl, buf, value, depth+1);
+ return;
+ case json_array:
+ dump_json_array(vpninfo, lvl, buf, value, depth+1);
+ return;
+ case json_integer:
+ buf_append(buf, "int: %10" PRId64 "\n", value->u.integer);
+ break;
+ case json_double:
+ buf_append(buf, "double: %f\n", value->u.dbl);
+ break;
+ case json_string:
+ buf_append(buf, "string: %s\n", value->u.string.ptr);
+ break;
+ case json_boolean:
+ buf_append(buf, "bool: %d\n", value->u.boolean);
+ break;
}
print_buf(vpninfo, lvl, buf);
val = load_be32(avp_p);
switch (val) {
- case 1: /* Prompt for both username and password. */
- prompt_flags = PROMPT_PASSWORD | PROMPT_USERNAME;
- break;
- case 3: /* Prompt for password.*/
- case 15:
- prompt_flags = PROMPT_PASSWORD;
- break;
- case 5: /* Prompt for username.*/
- prompt_flags = PROMPT_USERNAME;
- break;
-
- default:
- /* It does no harm to submit both, as anything unwanted is ignored. */
- vpn_progress(vpninfo, PRG_ERR,
- _("Unknown D73 prompt value 0x%x. Will prompt for both username and password.\n"),
- val);
- vpn_progress(vpninfo, PRG_ERR,
- _("Please report this value and the behaviour of the official client.\n"));
- prompt_flags = PROMPT_PASSWORD | PROMPT_USERNAME;
- break;
- }
+ case 1: /* Prompt for both username and password. */
+ prompt_flags = PROMPT_PASSWORD | PROMPT_USERNAME;
+ break;
+ case 3: /* Prompt for password.*/
+ case 15:
+ prompt_flags = PROMPT_PASSWORD;
+ break;
+ case 5: /* Prompt for username.*/
+ prompt_flags = PROMPT_USERNAME;
+ break;
+ default:
+ /* It does no harm to submit both, as anything unwanted is ignored. */
+ vpn_progress(vpninfo, PRG_ERR,
+ _("Unknown D73 prompt value 0x%x. Will prompt for both username and password.\n"),
+ val);
+ vpn_progress(vpninfo, PRG_ERR,
+ _("Please report this value and the behaviour of the official client.\n"));
+ prompt_flags = PROMPT_PASSWORD | PROMPT_USERNAME;
+ break;
+ }
} else if (avp_vendor == VENDOR_JUNIPER2 && avp_code == 0xd7b) {
free(signin_prompt);
signin_prompt = strndup(avp_p, avp_len);