version 1.1.1.1, 2012/02/21 17:26:12
|
version 1.1.1.2, 2016/11/02 10:09:11
|
Line 226 key_delete (struct keychain *keychain, struct key *key
|
Line 226 key_delete (struct keychain *keychain, struct key *key
|
free (key->string); |
free (key->string); |
key_free (key); |
key_free (key); |
} |
} |
| |
DEFUN (key_chain, |
DEFUN (key_chain, |
key_chain_cmd, |
key_chain_cmd, |
"key chain WORD", |
"key chain WORD", |
Line 381 key_str2time (const char *time_str, const char *day_st
|
Line 381 key_str2time (const char *time_str, const char *day_st
|
NULL |
NULL |
}; |
}; |
|
|
#define GET_LONG_RANGE(V,STR,MIN,MAX) \ | #define _GET_LONG_RANGE(V,STR,MMCOND) \ |
{ \ |
{ \ |
unsigned long tmpl; \ |
unsigned long tmpl; \ |
char *endptr = NULL; \ |
char *endptr = NULL; \ |
tmpl = strtoul ((STR), &endptr, 10); \ |
tmpl = strtoul ((STR), &endptr, 10); \ |
if (*endptr != '\0' || tmpl == ULONG_MAX) \ |
if (*endptr != '\0' || tmpl == ULONG_MAX) \ |
return -1; \ |
return -1; \ |
if ( tmpl < (MIN) || tmpl > (MAX)) \ | if (MMCOND) \ |
return -1; \ |
return -1; \ |
(V) = tmpl; \ |
(V) = tmpl; \ |
} |
} |
| #define GET_LONG_RANGE(V,STR,MIN,MAX) \ |
| _GET_LONG_RANGE(V,STR,tmpl < (MIN) || tmpl > (MAX)) |
| #define GET_LONG_RANGE0(V,STR,MAX) \ |
| _GET_LONG_RANGE(V,STR,tmpl > (MAX)) |
| |
/* Check hour field of time_str. */ |
/* Check hour field of time_str. */ |
colon = strchr (time_str, ':'); |
colon = strchr (time_str, ':'); |
if (colon == NULL) |
if (colon == NULL) |
Line 400 key_str2time (const char *time_str, const char *day_st
|
Line 404 key_str2time (const char *time_str, const char *day_st
|
*colon = '\0'; |
*colon = '\0'; |
|
|
/* Hour must be between 0 and 23. */ |
/* Hour must be between 0 and 23. */ |
GET_LONG_RANGE (hour, time_str, 0, 23); | GET_LONG_RANGE0 (hour, time_str, 23); |
|
|
/* Check min field of time_str. */ |
/* Check min field of time_str. */ |
time_str = colon + 1; |
time_str = colon + 1; |
Line 410 key_str2time (const char *time_str, const char *day_st
|
Line 414 key_str2time (const char *time_str, const char *day_st
|
*colon = '\0'; |
*colon = '\0'; |
|
|
/* Min must be between 0 and 59. */ |
/* Min must be between 0 and 59. */ |
GET_LONG_RANGE (min, time_str, 0, 59); | GET_LONG_RANGE0 (min, time_str, 59); |
|
|
/* Check sec field of time_str. */ |
/* Check sec field of time_str. */ |
time_str = colon + 1; |
time_str = colon + 1; |
Line 418 key_str2time (const char *time_str, const char *day_st
|
Line 422 key_str2time (const char *time_str, const char *day_st
|
return -1; |
return -1; |
|
|
/* Sec must be between 0 and 59. */ |
/* Sec must be between 0 and 59. */ |
GET_LONG_RANGE (sec, time_str, 0, 59); | GET_LONG_RANGE0 (sec, time_str, 59); |
|
|
/* Check day_str. Day must be <1-31>. */ |
/* Check day_str. Day must be <1-31>. */ |
GET_LONG_RANGE (day, day_str, 1, 31); |
GET_LONG_RANGE (day, day_str, 1, 31); |
Line 531 key_lifetime_infinite_set (struct vty *vty, struct key
|
Line 535 key_lifetime_infinite_set (struct vty *vty, struct key
|
|
|
return CMD_SUCCESS; |
return CMD_SUCCESS; |
} |
} |
| |
DEFUN (accept_lifetime_day_month_day_month, |
DEFUN (accept_lifetime_day_month_day_month, |
accept_lifetime_day_month_day_month_cmd, |
accept_lifetime_day_month_day_month_cmd, |
"accept-lifetime HH:MM:SS <1-31> MONTH <1993-2035> HH:MM:SS <1-31> MONTH <1993-2035>", |
"accept-lifetime HH:MM:SS <1-31> MONTH <1993-2035> HH:MM:SS <1-31> MONTH <1993-2035>", |
Line 689 DEFUN (accept_lifetime_duration_month_day,
|
Line 693 DEFUN (accept_lifetime_duration_month_day,
|
return key_lifetime_duration_set (vty, &key->accept, argv[0], argv[2], |
return key_lifetime_duration_set (vty, &key->accept, argv[0], argv[2], |
argv[1], argv[3], argv[4]); |
argv[1], argv[3], argv[4]); |
} |
} |
| |
DEFUN (send_lifetime_day_month_day_month, |
DEFUN (send_lifetime_day_month_day_month, |
send_lifetime_day_month_day_month_cmd, |
send_lifetime_day_month_day_month_cmd, |
"send-lifetime HH:MM:SS <1-31> MONTH <1993-2035> HH:MM:SS <1-31> MONTH <1993-2035>", |
"send-lifetime HH:MM:SS <1-31> MONTH <1993-2035> HH:MM:SS <1-31> MONTH <1993-2035>", |
Line 847 DEFUN (send_lifetime_duration_month_day,
|
Line 851 DEFUN (send_lifetime_duration_month_day,
|
return key_lifetime_duration_set (vty, &key->send, argv[0], argv[2], argv[1], |
return key_lifetime_duration_set (vty, &key->send, argv[0], argv[2], argv[1], |
argv[3], argv[4]); |
argv[3], argv[4]); |
} |
} |
| |
static struct cmd_node keychain_node = |
static struct cmd_node keychain_node = |
{ |
{ |
KEYCHAIN_NODE, |
KEYCHAIN_NODE, |