mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Ticket refs #1254: Improvement validation parameters
This commit is contained in:
parent
1f9c6b08d3
commit
a1f7ce98cf
43 changed files with 10438 additions and 6653 deletions
|
|
@ -2,7 +2,6 @@ LIB_BBFDM_VERSION = 3:0:0
|
|||
|
||||
lib_LTLIBRARIES = libbbf_api.la
|
||||
|
||||
|
||||
libbbf_api_la_SOURCES = \
|
||||
../libbbf_api/dmbbf.c \
|
||||
../libbbf_api/dmubus.c \
|
||||
|
|
@ -32,7 +31,6 @@ libbbf_api_la_LIBADD = \
|
|||
$(LIBJSON_LIBS) \
|
||||
$(LBLOBMSG_LIBS)
|
||||
|
||||
|
||||
lib_LTLIBRARIES += libbbfdm.la
|
||||
|
||||
libbbfdm_la_SOURCES = \
|
||||
|
|
@ -120,17 +118,17 @@ libbbfdm_la_CFLAGS = \
|
|||
$(LIBUCI_CFLAGS) \
|
||||
$(LIBUBOX_CFLAGS) \
|
||||
$(LIBUBUS_CFLAGS) \
|
||||
-Wall
|
||||
-Wall -Werror
|
||||
|
||||
libbbfdm_la_LDFLAGS = \
|
||||
$(AM_LDFLAGS) \
|
||||
$(LIBUCI_LDFLAGS) \
|
||||
$(LIBUBOX_LDFLAGS) \
|
||||
$(LIBUBUS_LDFLAGS) \
|
||||
$(LIBOPENSSL_LIBS) \
|
||||
$(LIBMBETLS_LIBS) \
|
||||
-share \
|
||||
-version-info $(LIB_BBFDM_VERSION) \
|
||||
-lssl \
|
||||
-lmbedtls
|
||||
-version-info $(LIB_BBFDM_VERSION)
|
||||
|
||||
libbbfdm_la_LIBADD = \
|
||||
$(AM_LIBS) \
|
||||
|
|
|
|||
|
|
@ -85,6 +85,12 @@ AC_SUBST([LBLOBMSG_LIBS])
|
|||
LIBDLOPEN_LIBS='-ldl'
|
||||
AC_SUBST([LIBDLOPEN_LIBS])
|
||||
|
||||
LIBOPENSSL_LIBS='-lssl'
|
||||
AC_SUBST([LIBOPENSSL_LIBS])
|
||||
|
||||
LIBMBETLS_LIBS='-lmbedtls'
|
||||
AC_SUBST([LIBMBETLS_LIBS])
|
||||
|
||||
# checks for header files
|
||||
AC_CHECK_HEADERS([stdlib.h string.h])
|
||||
|
||||
|
|
|
|||
|
|
@ -681,7 +681,7 @@ static int set_voice_profile_enable(char *refparam, struct dmctx *ctx, void *dat
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, ProfileEnable, NULL))
|
||||
if (dm_validate_string(value, -1, -1, ProfileEnable, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -732,7 +732,7 @@ static int set_voice_profile_signaling_protocol(char *refparam, struct dmctx *ct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -785,7 +785,7 @@ static int set_voice_profile_sip_proxyserver(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -810,7 +810,7 @@ static int set_sip_proxy_server_transport(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -835,7 +835,7 @@ static int set_voice_profile_sip_registerserver(char *refparam, struct dmctx *ct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -860,7 +860,7 @@ static int set_voice_profile_sip_registerserverport(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -885,7 +885,7 @@ static int set_sip_registrar_server_transport(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -910,7 +910,7 @@ static int set_sip_user_agent_domain(char *refparam, struct dmctx *ctx, void *da
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -931,7 +931,7 @@ static int set_sip_user_agent_port(char *refparam, struct dmctx *ctx, void *data
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -960,7 +960,7 @@ static int set_sip_user_agent_transport(char *refparam, struct dmctx *ctx, void
|
|||
struct sip_args *sipargs = (struct sip_args *)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -986,7 +986,7 @@ static int set_sip_outbound_proxy(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1010,7 +1010,7 @@ static int set_sip_outbound_proxy_port(char *refparam, struct dmctx *ctx, void *
|
|||
struct sip_args *sipargs = (struct sip_args *)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1031,7 +1031,7 @@ static int set_sip_registration_period(char *refparam, struct dmctx *ctx, void *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1052,7 +1052,7 @@ static int set_sip_re_invite_expires(char *refparam, struct dmctx *ctx, void *da
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1107,7 +1107,7 @@ static int set_voice_profile_sip_dtmfmethod(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", DTMFMethod, NULL))
|
||||
if (dm_validate_string(value, -1, 64, DTMFMethod, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1142,7 +1142,7 @@ static int set_sip_profile_region(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1174,7 +1174,7 @@ static int set_voice_service_serviceproviderinfo_name(char *refparam, struct dmc
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1224,7 +1224,7 @@ static int set_voice_service_vp_rtp_portmin(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1251,7 +1251,7 @@ static int set_voice_profile_rtp_localportmax(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1283,7 +1283,7 @@ static int set_voice_service_vp_rtp_dscp(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "63"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","63"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1321,7 +1321,7 @@ static int set_voice_service_vp_rtp_rtcp_txrepeatinterval(char *refparam, struct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1382,7 +1382,7 @@ static int set_voice_profile_line_enable(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_boolean(value))
|
||||
if (dm_validate_string(value, -1, -1, ProfileEnable, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1409,7 +1409,7 @@ static int set_line_directory_number(char *refparam, struct dmctx *ctx, void *da
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "32", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 32, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1636,7 +1636,7 @@ static int set_line_calling_features_caller_id_name(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1688,7 +1688,7 @@ static int set_line_sip_auth_username(char *refparam, struct dmctx *ctx, void *d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "128", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 128, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1704,7 +1704,7 @@ static int set_line_sip_auth_password(char *refparam, struct dmctx *ctx, void *d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "128", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 128, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1735,7 +1735,7 @@ static int set_line_sip_uri(char *refparam, struct dmctx *ctx, void *data, char
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "389", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 389, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1926,7 +1926,7 @@ static int set_line_codec_list_packetization(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, NULL, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, -1, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1981,7 +1981,7 @@ static int set_line_codec_list_priority(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2038,7 +2038,7 @@ static int set_service_alias(char *refparam, struct dmctx *ctx, void *data, char
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2061,7 +2061,7 @@ static int set_cap_codec_alias(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2089,7 +2089,7 @@ static int set_voice_profile_alias(char *refparam, struct dmctx *ctx, void *data
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2119,7 +2119,7 @@ static int set_line_alias(char *refparam, struct dmctx *ctx, void *data, char *i
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2141,7 +2141,7 @@ static int set_line_codec_list_alias(char *refparam, struct dmctx *ctx, void *da
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ static int set_ip_ping_diagnostics_state(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DiagnosticsState, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DiagnosticsState, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -75,7 +75,7 @@ static int set_ip_ping_interface(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -102,7 +102,7 @@ static int set_ip_ping_protocolversion(char *refparam, struct dmctx *ctx, void *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, ProtocolVersion, NULL))
|
||||
if (dm_validate_string(value, -1, -1, ProtocolVersion, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -129,7 +129,7 @@ static int set_ip_ping_host(char *refparam, struct dmctx *ctx, void *data, char
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -156,7 +156,7 @@ static int set_ip_ping_repetition_number(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -183,7 +183,7 @@ static int set_ip_ping_timeout(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -211,7 +211,7 @@ static int set_ip_ping_block_size(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -237,7 +237,7 @@ static int set_ip_ping_DSCP(char *refparam, struct dmctx *ctx, void *data, char
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "63"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","63"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -326,7 +326,7 @@ static int set_IPDiagnosticsTraceRoute_DiagnosticsState(char *refparam, struct d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DiagnosticsState, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DiagnosticsState, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -356,7 +356,7 @@ static int set_IPDiagnosticsTraceRoute_Interface(char *refparam, struct dmctx *c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -383,7 +383,7 @@ static int set_IPDiagnosticsTraceRoute_ProtocolVersion(char *refparam, struct dm
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, ProtocolVersion, NULL))
|
||||
if (dm_validate_string(value, -1, -1, ProtocolVersion, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -410,7 +410,7 @@ static int set_IPDiagnosticsTraceRoute_Host(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -437,7 +437,7 @@ static int set_IPDiagnosticsTraceRoute_NumberOfTries(char *refparam, struct dmct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "3"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","3"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -464,7 +464,7 @@ static int set_IPDiagnosticsTraceRoute_Timeout(char *refparam, struct dmctx *ctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -491,7 +491,7 @@ static int set_IPDiagnosticsTraceRoute_DataBlockSize(char *refparam, struct dmct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -518,7 +518,7 @@ static int set_IPDiagnosticsTraceRoute_DSCP(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "63"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","63"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -545,7 +545,7 @@ static int set_IPDiagnosticsTraceRoute_MaxHopCount(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "64"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","64"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -622,7 +622,7 @@ static int set_IPDiagnosticsDownloadDiagnostics_DiagnosticsState(char *refparam,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DiagnosticsState, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DiagnosticsState, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -657,7 +657,7 @@ static int set_IPDiagnosticsDownloadDiagnostics_Interface(char *refparam, struct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -693,7 +693,7 @@ static int set_IPDiagnosticsDownloadDiagnostics_DownloadURL(char *refparam, stru
|
|||
struct uci_section *curr_section = NULL;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -732,7 +732,7 @@ static int set_IPDiagnosticsDownloadDiagnostics_DSCP(char *refparam, struct dmct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "63"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","63"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -759,7 +759,7 @@ static int set_IPDiagnosticsDownloadDiagnostics_EthernetPriority(char *refparam,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "7"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","7"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -786,7 +786,7 @@ static int set_IPDiagnosticsDownloadDiagnostics_ProtocolVersion(char *refparam,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, ProtocolVersion, NULL))
|
||||
if (dm_validate_string(value, -1, -1, ProtocolVersion, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -813,7 +813,7 @@ static int set_IPDiagnosticsDownloadDiagnostics_NumberOfConnections(char *refpar
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1011,7 +1011,7 @@ static int set_IPDiagnosticsUploadDiagnostics_DiagnosticsState(char *refparam, s
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DiagnosticsState, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DiagnosticsState, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1046,7 +1046,7 @@ static int set_IPDiagnosticsUploadDiagnostics_Interface(char *refparam, struct d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1083,7 +1083,7 @@ static int set_IPDiagnosticsUploadDiagnostics_UploadURL(char *refparam, struct d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1116,7 +1116,7 @@ static int set_IPDiagnosticsUploadDiagnostics_DSCP(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "63"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","63"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1143,7 +1143,7 @@ static int set_IPDiagnosticsUploadDiagnostics_EthernetPriority(char *refparam, s
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "7"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","7"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1169,7 +1169,7 @@ static int set_IPDiagnosticsUploadDiagnostics_TestFileLength(char *refparam, str
|
|||
struct uci_section *curr_section = NULL;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1196,7 +1196,7 @@ static int set_IPDiagnosticsUploadDiagnostics_ProtocolVersion(char *refparam, st
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, ProtocolVersion, NULL))
|
||||
if (dm_validate_string(value, -1, -1, ProtocolVersion, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1222,7 +1222,7 @@ static int set_IPDiagnosticsUploadDiagnostics_NumberOfConnections(char *refparam
|
|||
struct uci_section *curr_section = NULL;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1437,7 +1437,7 @@ static int set_IPDiagnosticsUDPEchoConfig_Interface(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1457,7 +1457,7 @@ static int set_IPDiagnosticsUDPEchoConfig_SourceIPAddress(char *refparam, struct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPAddress))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1477,7 +1477,7 @@ static int set_IPDiagnosticsUDPEchoConfig_UDPPort(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1589,7 +1589,7 @@ static int set_IPDiagnosticsUDPEchoDiagnostics_DiagnosticsState(char *refparam,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DiagnosticsState, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DiagnosticsState, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1619,7 +1619,7 @@ static int set_IPDiagnosticsUDPEchoDiagnostics_Interface(char *refparam, struct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1646,7 +1646,7 @@ static int set_IPDiagnosticsUDPEchoDiagnostics_Host(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1673,7 +1673,7 @@ static int set_IPDiagnosticsUDPEchoDiagnostics_Port(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1700,7 +1700,7 @@ static int set_IPDiagnosticsUDPEchoDiagnostics_NumberOfRepetitions(char *refpara
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1727,7 +1727,7 @@ static int set_IPDiagnosticsUDPEchoDiagnostics_Timeout(char *refparam, struct dm
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1754,7 +1754,7 @@ static int set_IPDiagnosticsUDPEchoDiagnostics_DataBlockSize(char *refparam, str
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1781,7 +1781,7 @@ static int set_IPDiagnosticsUDPEchoDiagnostics_DSCP(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "63"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","63"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1808,7 +1808,7 @@ static int set_IPDiagnosticsUDPEchoDiagnostics_InterTransmissionTime(char *refpa
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1835,7 +1835,7 @@ static int set_IPDiagnosticsUDPEchoDiagnostics_ProtocolVersion(char *refparam, s
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, ProtocolVersion, NULL))
|
||||
if (dm_validate_string(value, -1, -1, ProtocolVersion, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1906,7 +1906,7 @@ static int set_IPDiagnosticsServerSelectionDiagnostics_DiagnosticsState(char *re
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DiagnosticsState, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DiagnosticsState, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1936,7 +1936,7 @@ static int set_IPDiagnosticsServerSelectionDiagnostics_Interface(char *refparam,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1963,7 +1963,7 @@ static int set_IPDiagnosticsServerSelectionDiagnostics_ProtocolVersion(char *ref
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, ProtocolVersion, NULL))
|
||||
if (dm_validate_string(value, -1, -1, ProtocolVersion, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1990,7 +1990,7 @@ static int set_IPDiagnosticsServerSelectionDiagnostics_Protocol(char *refparam,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, ServerSelectionProtocol, NULL))
|
||||
if (dm_validate_string(value, -1, -1, ServerSelectionProtocol, 2, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2017,7 +2017,7 @@ static int set_IPDiagnosticsServerSelectionDiagnostics_Port(char *refparam, stru
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2044,7 +2044,7 @@ static int set_IPDiagnosticsServerSelectionDiagnostics_HostList(char *refparam,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, "10", NULL, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, 10, -1, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2071,7 +2071,7 @@ static int set_IPDiagnosticsServerSelectionDiagnostics_NumberOfRepetitions(char
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2098,7 +2098,7 @@ static int set_IPDiagnosticsServerSelectionDiagnostics_Timeout(char *refparam, s
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ static int set_BulkDataProfile_Alias(char *refparam, struct dmctx *ctx, void *da
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -372,7 +372,7 @@ static int set_BulkDataProfile_Name(char *refparam, struct dmctx *ctx, void *dat
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "255", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 255, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -393,7 +393,7 @@ static int set_BulkDataProfile_NumberOfRetainedFailedReports(char *refparam, str
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -416,7 +416,7 @@ static int set_BulkDataProfile_Protocol(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, BulkDataProtocols, NULL))
|
||||
if (dm_validate_string(value, -1, -1, BulkDataProtocols, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -442,7 +442,7 @@ static int set_BulkDataProfile_EncodingType(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, EncodingTypes, NULL))
|
||||
if (dm_validate_string(value, -1, -1, EncodingTypes, 4, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -466,7 +466,7 @@ static int set_BulkDataProfile_ReportingInterval(char *refparam, struct dmctx *c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -542,7 +542,7 @@ static int set_BulkDataProfileParameter_Name(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -563,7 +563,7 @@ static int set_BulkDataProfileParameter_Reference(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -584,7 +584,7 @@ static int set_BulkDataProfileCSVEncoding_FieldSeparator(char *refparam, struct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -605,7 +605,7 @@ static int set_BulkDataProfileCSVEncoding_RowSeparator(char *refparam, struct dm
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -627,7 +627,7 @@ static int set_BulkDataProfileCSVEncoding_EscapeCharacter(char *refparam, struct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -653,7 +653,7 @@ static int set_BulkDataProfileCSVEncoding_ReportFormat(char *refparam, struct dm
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, CSVReportFormat, NULL))
|
||||
if (dm_validate_string(value, -1, -1, CSVReportFormat, 2, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -683,7 +683,7 @@ static int set_BulkDataProfileCSVEncoding_RowTimestamp(char *refparam, struct dm
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, RowTimestamp, NULL))
|
||||
if (dm_validate_string(value, -1, -1, RowTimestamp, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -713,7 +713,7 @@ static int set_BulkDataProfileJSONEncoding_ReportFormat(char *refparam, struct d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, JSONReportFormat, NULL))
|
||||
if (dm_validate_string(value, -1, -1, JSONReportFormat, 2, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -743,7 +743,7 @@ static int set_BulkDataProfileJSONEncoding_ReportTimestamp(char *refparam, struc
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, RowTimestamp, NULL))
|
||||
if (dm_validate_string(value, -1, -1, RowTimestamp, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -769,7 +769,7 @@ static int set_BulkDataProfileHTTP_URL(char *refparam, struct dmctx *ctx, void *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "1024", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 1024, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -790,7 +790,7 @@ static int set_BulkDataProfileHTTP_Username(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -811,7 +811,7 @@ static int set_BulkDataProfileHTTP_Password(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -844,7 +844,7 @@ static int set_BulkDataProfileHTTP_Compression(char *refparam, struct dmctx *ctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -880,7 +880,7 @@ static int set_BulkDataProfileHTTP_Method(char *refparam, struct dmctx *ctx, voi
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -952,7 +952,7 @@ static int set_BulkDataProfileHTTP_RetryMinimumWaitInterval(char *refparam, stru
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -973,7 +973,7 @@ static int set_BulkDataProfileHTTP_RetryIntervalMultiplier(char *refparam, struc
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1000", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1000","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1036,7 +1036,7 @@ static int set_BulkDataProfileHTTPRequestURIParameter_Name(char *refparam, struc
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1057,7 +1057,7 @@ static int set_BulkDataProfileHTTPRequestURIParameter_Reference(char *refparam,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ static int set_SoftwareModulesExecEnv_Alias(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -398,7 +398,7 @@ static int set_SoftwareModulesDeploymentUnit_Alias(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -567,7 +567,7 @@ static int set_SoftwareModulesExecutionUnit_Alias(char *refparam, struct dmctx *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ static int set_atm_destination_address(char *refparam, struct dmctx *ctx, void *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, DestinationAddress))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, DestinationAddress, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -103,7 +103,7 @@ static int set_atm_encapsulation(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, Encapsulation, NULL))
|
||||
if (dm_validate_string(value, -1, -1, Encapsulation, 2, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -139,7 +139,7 @@ static int set_atm_link_type(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, LinkType, NULL))
|
||||
if (dm_validate_string(value, -1, -1, LinkType, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -312,7 +312,7 @@ static int set_atm_alias(char *refparam, struct dmctx *ctx, void *data, char *in
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ static int set_br_standard(char *refparam, struct dmctx *ctx, void *data, char *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, BridgeStandard, NULL))
|
||||
if (dm_validate_string(value, -1, -1, BridgeStandard, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -435,7 +435,7 @@ static int set_br_associated_interfaces(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -562,7 +562,7 @@ static int set_br_port_type(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, BridgeType, NULL))
|
||||
if (dm_validate_string(value, -1, -1, BridgeType, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -594,7 +594,7 @@ static int set_br_port_default_user_priority(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "7"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","7"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -620,7 +620,7 @@ static int set_br_port_priority_regeneration(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt_list(value, "8", "8", NULL, "0", "7"))
|
||||
if (dm_validate_unsignedInt_list(value, 8, 8, -1, RANGE_ARGS{{"0","7"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -665,7 +665,7 @@ static int set_br_port_pvid(char *refparam, struct dmctx *ctx, void *data, char
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "1", "4094"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"1","4094"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -709,7 +709,7 @@ static int set_br_port_tpid(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -874,7 +874,7 @@ static int set_br_vlan_name(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -897,7 +897,7 @@ static int set_br_vlan_vid(char *refparam, struct dmctx *ctx, void *data, char *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "1", "4094"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"1","4094"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -953,7 +953,7 @@ static int set_br_alias(char *refparam, struct dmctx *ctx, void *data, char *ins
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -982,7 +982,7 @@ static int set_br_port_alias(char *refparam, struct dmctx *ctx, void *data, char
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1011,7 +1011,7 @@ static int set_br_vlan_alias(char *refparam, struct dmctx *ctx, void *data, char
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1339,7 +1339,7 @@ static int set_port_lower_layer(char *refparam, struct dmctx *ctx, void *data, c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "1024", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 1024, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
get_dmmap_section_of_config_section("dmmap_bridge_port", "bridge_port", section_name(((struct bridging_port_args *)data)->bridge_port_sec), &dmmap_section);
|
||||
dmuci_get_value_by_section_string(dmmap_section, "mg_port", &mg_port);
|
||||
|
|
@ -1423,7 +1423,7 @@ static int set_vlan_port_vlan_ref(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1449,7 +1449,7 @@ static int set_vlan_port_port_ref(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
#include "datamodelversion.h"
|
||||
#include "gre.h"
|
||||
#include "dynamicdns.h"
|
||||
#include "security.h"
|
||||
#ifdef BBF_TR104
|
||||
#include "voice_services.h"
|
||||
#endif
|
||||
|
|
@ -56,7 +57,6 @@
|
|||
#include "bulkdata.h"
|
||||
#include "softwaremodules.h"
|
||||
#endif
|
||||
#include "security.h"
|
||||
|
||||
/* *** BBFDM *** */
|
||||
DMOBJ tEntry181Obj[] = {
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ static int set_device_provisioningcode(char *refparam, struct dmctx *ctx, void *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -372,7 +372,7 @@ static int set_vcf_alias(char *refparam, struct dmctx *ctx, void *data, char *in
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -408,7 +408,7 @@ static int set_vlf_alias(char *refparam, struct dmctx *ctx, void *data, char *in
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -564,7 +564,7 @@ static int set_server_pool_alias(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -609,7 +609,7 @@ static int set_dns_server(char *refparam, struct dmctx *ctx, void *data, char *i
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, "4", NULL, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string_list(value, -1, 4, -1, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -700,7 +700,7 @@ static int set_dhcp_sever_pool_order(char *refparam, struct dmctx *ctx, void *da
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -866,7 +866,7 @@ static int set_dhcp_address_min(char *refparam, struct dmctx *ctx, void *data, c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string(value, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -914,7 +914,7 @@ static int set_dhcp_address_max(char *refparam, struct dmctx *ctx, void *data, c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string(value, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -995,7 +995,7 @@ static int set_dhcp_reserved_addresses(char *refparam, struct dmctx *ctx, void *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, "32", NULL, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string_list(value, -1, 32, -1, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1061,7 +1061,7 @@ static int set_dhcp_subnetmask(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string(value, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1088,7 +1088,7 @@ static int set_dhcp_iprouters(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, "4", NULL, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string_list(value, -1, 4, -1, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1172,7 +1172,7 @@ static int set_dhcp_leasetime(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1204,7 +1204,7 @@ static int set_dhcp_interface_linker_parameter(char *refparam, struct dmctx *ctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1249,7 +1249,7 @@ static int set_dhcp_domainname(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1287,7 +1287,7 @@ static int set_dhcp_static_alias(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1318,7 +1318,7 @@ static int set_dhcp_staticaddress_chaddr(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "17", NULL, MACAddress))
|
||||
if (dm_validate_string(value, -1, 17, NULL, 0, MACAddress, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1343,7 +1343,7 @@ static int set_dhcp_staticaddress_yiaddr(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string(value, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1448,7 +1448,7 @@ static int set_DHCPv4Client_Alias(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1478,7 +1478,7 @@ static int set_DHCPv4Client_Interface(char *refparam, struct dmctx *ctx, void *d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
|
||||
if(strlen(value) == 0 || strcmp(value, "") == 0)
|
||||
|
|
@ -1749,7 +1749,7 @@ static int set_DHCPv4ClientSentOption_Alias(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1772,7 +1772,7 @@ static int set_DHCPv4ClientSentOption_Tag(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "254"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","254"}}, 1))
|
||||
return FAULT_9007;
|
||||
dmuci_get_value_by_section_string(((struct dhcp_client_option_args *)data)->client_sect, "sendopts", &v);
|
||||
if (v == NULL)
|
||||
|
|
@ -1810,7 +1810,7 @@ static int set_DHCPv4ClientSentOption_Value(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, "0", "255"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{"0","255"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1881,7 +1881,7 @@ static int set_DHCPv4ClientReqOption_Alias(char *refparam, struct dmctx *ctx, vo
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1903,7 +1903,7 @@ static int set_DHCPv4ClientReqOption_Tag(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "254"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","254"}}, 1))
|
||||
return FAULT_9007;
|
||||
|
||||
dmuci_get_value_by_section_string(((struct dhcp_client_option_args *)data)->client_sect, "reqopts", &v);
|
||||
|
|
@ -2010,7 +2010,7 @@ static int set_DHCPv4ServerPoolOption_Alias(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2035,7 +2035,7 @@ static int set_DHCPv4ServerPoolOption_Tag(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "254"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","254"}}, 1))
|
||||
return FAULT_9007;
|
||||
|
||||
dmuci_get_value_by_section_list(((struct dhcp_client_option_args *)data)->client_sect, "dhcp_option", &dhcp_option_list);
|
||||
|
|
@ -2074,7 +2074,7 @@ static int set_DHCPv4ServerPoolOption_Value(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, "0", "255"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{"0","255"}}, 1))
|
||||
return FAULT_9007;
|
||||
|
||||
dmuci_get_value_by_section_list(((struct dhcp_client_option_args *)data)->client_sect, "dhcp_option", &dhcp_option_list);
|
||||
|
|
@ -2144,7 +2144,7 @@ static int set_DHCPv4RelayForwarding_Alias(char *refparam, struct dmctx *ctx, vo
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2172,7 +2172,7 @@ static int set_DHCPv4RelayForwarding_Interface(char *refparam, struct dmctx *ctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
|
||||
if (strlen(value) == 0 || strcmp(value, "") == 0)
|
||||
|
|
@ -2222,7 +2222,7 @@ static int set_DHCPv4RelayForwarding_VendorClassID(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "255", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 255, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2269,7 +2269,7 @@ static int set_DHCPv4RelayForwarding_Chaddr(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "17", NULL, MACAddress))
|
||||
if (dm_validate_string(value, -1, 17, NULL, 0, MACAddress, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2314,7 +2314,7 @@ static int set_DHCPv4RelayForwarding_ChaddrMask(char *refparam, struct dmctx *ct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "17", NULL, MACAddress))
|
||||
if (dm_validate_string(value, -1, 17, NULL, 0, MACAddress, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2373,7 +2373,7 @@ static int set_DHCPv4RelayForwarding_UserClassID(char *refparam, struct dmctx *c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "255"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"255"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -515,7 +515,7 @@ static int set_DHCPv6Client_Alias(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -544,7 +544,7 @@ static int set_DHCPv6Client_Interface(char *refparam, struct dmctx *ctx, void *d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
|
||||
if (strlen(value) == 0 || strcmp(value, "") == 0) {
|
||||
|
|
@ -722,7 +722,7 @@ static int set_DHCPv6Client_RequestedOptions(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt_list(value, NULL, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_unsignedInt_list(value, -1, -1, -1, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -843,7 +843,7 @@ static int set_DHCPv6ServerPool_Alias(char *refparam, struct dmctx *ctx, void *d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -871,7 +871,7 @@ static int set_DHCPv6ServerPool_Order(char *refparam, struct dmctx *ctx, void *d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -900,7 +900,7 @@ static int set_DHCPv6ServerPool_Interface(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -929,7 +929,7 @@ static int set_DHCPv6ServerPool_VendorClassID(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -956,7 +956,7 @@ static int set_DHCPv6ServerPool_UserClassID(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1005,7 +1005,7 @@ static int set_DHCPv6ServerPool_SourceAddress(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPv6Address))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPv6Address, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1050,7 +1050,7 @@ static int set_DHCPv6ServerPool_SourceAddressMask(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPv6Address))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPv6Address, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1243,7 +1243,7 @@ static int set_DHCPv6ServerPoolOption_Alias(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1268,7 +1268,7 @@ static int set_DHCPv6ServerPoolOption_Tag(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
|
||||
dmuci_get_value_by_section_list(((struct dhcpv6_client_option_args *)data)->client_sect, "dhcp_option", &dhcp_option_list);
|
||||
|
|
@ -1309,7 +1309,7 @@ static int set_DHCPv6ServerPoolOption_Value(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, "0", "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
|
||||
dmuci_get_value_by_section_list(((struct dhcpv6_client_option_args *)data)->client_sect, "dhcp_option", &dhcp_option_list);
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ static int set_server_alias(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -615,7 +615,7 @@ static int set_server_dns_server(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPAddress))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -656,7 +656,7 @@ static int set_server_interface(char *refparam, struct dmctx *ctx, void *data, c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -730,7 +730,7 @@ static int set_forwarding_alias(char *refparam, struct dmctx *ctx, void *data, c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -750,7 +750,7 @@ static int set_forwarding_dns_server(char *refparam, struct dmctx *ctx, void *da
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPAddress))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -791,7 +791,7 @@ static int set_forwarding_interface(char *refparam, struct dmctx *ctx, void *dat
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -820,7 +820,7 @@ static int set_nslookupdiagnostics_diagnostics_state(char *refparam, struct dmct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DiagnosticsState, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DiagnosticsState, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -844,7 +844,7 @@ static int set_nslookupdiagnostics_interface(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -865,7 +865,7 @@ static int set_nslookupdiagnostics_host_name(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -886,7 +886,7 @@ static int set_nslookupdiagnostics_d_n_s_server(char *refparam, struct dmctx *ct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -907,7 +907,7 @@ static int set_nslookupdiagnostics_timeout(char *refparam, struct dmctx *ctx, vo
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -928,7 +928,7 @@ static int set_nslookupdiagnostics_number_of_repetitions(char *refparam, struct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ static int set_DSLLine_Alias(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -302,7 +302,7 @@ static int set_DSLLine_LowerLayers(char *refparam, struct dmctx *ctx, void *data
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "1024", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 1024, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -903,7 +903,7 @@ static int set_DSLChannel_Alias(char *refparam, struct dmctx *ctx, void *data, c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ static int set_DynamicDNSClient_Alias(char *refparam, struct dmctx *ctx, void *d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -473,7 +473,7 @@ static int set_DynamicDNSClient_Server(char *refparam, struct dmctx *ctx, void *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -504,7 +504,7 @@ static int set_DynamicDNSClient_Interface(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -529,7 +529,7 @@ static int set_DynamicDNSClient_Username(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -550,7 +550,7 @@ static int set_DynamicDNSClient_Password(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -636,7 +636,7 @@ static int set_DynamicDNSClientHostname_Name(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -702,7 +702,7 @@ static int set_DynamicDNSServer_Enable(char *refparam, struct dmctx *ctx, void *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -729,7 +729,7 @@ static int set_DynamicDNSServer_Name(char *refparam, struct dmctx *ctx, void *da
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -754,7 +754,7 @@ static int set_DynamicDNSServer_Alias(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -778,7 +778,7 @@ static int set_DynamicDNSServer_ServiceName(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -816,7 +816,7 @@ static int set_DynamicDNSServer_ServerAddress(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -873,7 +873,7 @@ static int set_DynamicDNSServer_ServerPort(char *refparam, struct dmctx *ctx, vo
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -935,7 +935,7 @@ static int set_DynamicDNSServer_Protocol(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, SupportedProtocols, NULL))
|
||||
if (dm_validate_string(value, -1, -1, SupportedProtocols, 2, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -972,7 +972,7 @@ static int set_DynamicDNSServer_CheckInterval(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1012,7 +1012,7 @@ static int set_DynamicDNSServer_RetryInterval(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1050,7 +1050,7 @@ static int set_DynamicDNSServer_MaxRetries(char *refparam, struct dmctx *ctx, vo
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@ static int set_EthernetInterface_Alias(char *refparam, struct dmctx *ctx, void *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -492,7 +492,7 @@ static int set_EthernetInterface_LowerLayers(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "1024", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 1024, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -543,7 +543,7 @@ static int set_EthernetInterface_MaxBitRate(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -608,7 +608,7 @@ static int set_EthernetInterface_DuplexMode(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DuplexMode, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DuplexMode, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -734,7 +734,7 @@ static int set_EthernetLink_Alias(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -817,7 +817,7 @@ static int set_EthernetLink_LowerLayers(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "1024", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 1024, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -925,7 +925,7 @@ static int set_EthernetVLANTermination_Alias(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -997,7 +997,7 @@ static int set_EthernetVLANTermination_LowerLayers(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "1024", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 1024, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1040,7 +1040,7 @@ static int set_EthernetVLANTermination_VLANID(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "4094"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","4094"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET: {
|
||||
|
|
@ -1079,7 +1079,7 @@ static int set_EthernetVLANTermination_TPID(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -623,7 +623,7 @@ static int set_firewall_config(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, Config, NULL))
|
||||
if (dm_validate_string(value, -1, -1, Config, 4, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -638,7 +638,7 @@ static int set_firewall_advanced_level(char *refparam, struct dmctx *ctx, void *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -653,7 +653,7 @@ static int set_level_name(char *refparam, struct dmctx *ctx, void *data, char *i
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -667,7 +667,7 @@ static int set_level_description(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -752,7 +752,7 @@ static int set_chain_name(char *refparam, struct dmctx *ctx, void *data, char *i
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -783,7 +783,7 @@ static int set_rule_order(char *refparam, struct dmctx *ctx, void *data, char *i
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -798,7 +798,7 @@ static int set_rule_description(char *refparam, struct dmctx *ctx, void *data, c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -814,7 +814,7 @@ static int set_rule_target(char *refparam, struct dmctx *ctx, void *data, char *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, Target, NULL))
|
||||
if (dm_validate_string(value, -1, -1, Target, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -838,7 +838,7 @@ static int set_rule_source_interface(char *refparam, struct dmctx *ctx, void *da
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
|
||||
adm_entry_get_linker_value(ctx, value, &iface);
|
||||
|
|
@ -869,7 +869,7 @@ static int set_rule_dest_interface(char *refparam, struct dmctx *ctx, void *data
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -893,7 +893,7 @@ static int set_rule_i_p_version(char *refparam, struct dmctx *ctx, void *data, c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "15"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","15"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -914,7 +914,7 @@ static int set_rule_dest_ip(char *refparam, struct dmctx *ctx, void *data, char
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPAddress))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -937,7 +937,7 @@ static int set_rule_dest_mask(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "49", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 49, NULL, 0, IPPrefix, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -959,7 +959,7 @@ static int set_rule_source_ip(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPAddress))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -982,7 +982,7 @@ static int set_rule_source_mask(char *refparam, struct dmctx *ctx, void *data, c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "49", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 49, NULL, 0, IPPrefix, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1002,7 +1002,7 @@ static int set_rule_protocol(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "255"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","255"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1018,7 +1018,7 @@ static int set_rule_dest_port(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "65535"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1044,7 +1044,7 @@ static int set_rule_dest_port_range_max(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "65535"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1073,7 +1073,7 @@ static int set_rule_source_port(char *refparam, struct dmctx *ctx, void *data, c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "65535"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1099,7 +1099,7 @@ static int set_rule_source_port_range_max(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "65535"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ static int set_GRETunnel_Alias(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -263,7 +263,7 @@ static int set_GRETunnel_KeepAliveThreshold(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -345,7 +345,7 @@ static int set_GRETunnelInterface_Alias(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -484,7 +484,7 @@ static int set_InterfaceStack_Alias(char *refparam, struct dmctx *ctx, void *dat
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ static int set_IP_ULAPrefix(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "49", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 49, NULL, 0, IPv6Prefix, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -354,7 +354,7 @@ static int set_IPInterface_Router(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -401,7 +401,7 @@ static int set_IPInterface_MaxMTUSize(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "64", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"64","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -568,7 +568,7 @@ static int set_ipv4_address(char *refparam, struct dmctx *ctx, void *data, char
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string(value, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -606,7 +606,7 @@ static int set_ipv4_netmask(char *refparam, struct dmctx *ctx, void *data, char
|
|||
char *proto;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string(value, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -670,7 +670,7 @@ static int set_IPInterface_LowerLayers(char *refparam, struct dmctx *ctx, void *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "1024", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 1024, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -707,7 +707,7 @@ static int set_IPInterfaceIPv6Address_IPAddress(char *refparam, struct dmctx *ct
|
|||
char *proto;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPv6Address))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPv6Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -788,7 +788,7 @@ static int set_IPInterfaceIPv6Address_Prefix(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -916,7 +916,7 @@ static int set_IPInterfaceIPv6Prefix_Prefix(char *refparam, struct dmctx *ctx, v
|
|||
char *proto;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "49", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 49, NULL, 0, IPv6Prefix, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -955,7 +955,7 @@ static int set_IPInterfaceIPv6Prefix_StaticType(char *refparam, struct dmctx *ct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, StaticType, NULL))
|
||||
if (dm_validate_string(value, -1, -1, StaticType, 4, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -979,7 +979,7 @@ static int set_IPInterfaceIPv6Prefix_ParentPrefix(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -998,7 +998,7 @@ static int set_IPInterfaceIPv6Prefix_ChildPrefixBits(char *refparam, struct dmct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "49", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 49, NULL, 0, IPv6Prefix, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1185,7 +1185,7 @@ static int set_IPInterfaceTWAMPReflector_Alias(char *refparam, struct dmctx *ctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1205,7 +1205,7 @@ static int set_IPInterfaceTWAMPReflector_Port(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1225,7 +1225,7 @@ static int set_IPInterfaceTWAMPReflector_MaximumTTL(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "255"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","255"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1245,7 +1245,7 @@ static int set_IPInterfaceTWAMPReflector_IPAllowedList(char *refparam, struct dm
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "255", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 255, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1265,7 +1265,7 @@ static int set_IPInterfaceTWAMPReflector_PortAllowedList(char *refparam, struct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "255", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 255, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1294,6 +1294,8 @@ static int set_IPInterface_Alias(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
get_dmmap_section_of_config_section("dmmap_network", "interface", section_name(((struct ip_args *)data)->ip_sec), &dmmap_section);
|
||||
|
|
@ -1320,6 +1322,8 @@ static int set_ipv4_alias(char *refparam, struct dmctx *ctx, void *data, char *i
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
get_dmmap_section_of_config_section("dmmap_network", "interface", section_name(((struct ip_args *)data)->ip_sec), &dmmap_section);
|
||||
|
|
@ -1350,6 +1354,8 @@ static int set_IPInterfaceIPv6Address_Alias(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
uci_path_foreach_option_eq(bbfdm, "dmmap_network", "ipv6", "ipv6_instance", instance, dmmap_section) {
|
||||
|
|
@ -1384,6 +1390,8 @@ static int set_IPInterfaceIPv6Prefix_Alias(char *refparam, struct dmctx *ctx, vo
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
uci_path_foreach_option_eq(bbfdm, "dmmap_network", "ipv6prefix", "ipv6prefix_instance", instance, dmmap_section) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ static int set_management_server_url(char *refparam, struct dmctx *ctx, void *da
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -57,7 +57,7 @@ static int set_management_server_username(char *refparam, struct dmctx *ctx, voi
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -73,7 +73,7 @@ static int set_management_server_passwd(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -127,7 +127,7 @@ static int set_management_server_periodic_inform_interval(char *refparam, struct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -202,7 +202,7 @@ static int set_management_server_connection_request_username(char *refparam, str
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -218,7 +218,7 @@ static int set_management_server_connection_request_passwd(char *refparam, struc
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -251,7 +251,7 @@ static int set_lwn_protocol_used(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, -1, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -276,7 +276,7 @@ static int set_lwn_host(char *refparam, struct dmctx *ctx, void *data, char *ins
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -298,7 +298,7 @@ static int set_lwn_port(char *refparam, struct dmctx *ctx, void *data, char *ins
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -326,7 +326,7 @@ static int set_management_server_http_compression(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -350,7 +350,7 @@ static int set_management_server_retry_min_wait_interval(char *refparam, struct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -372,7 +372,7 @@ static int set_management_server_retry_interval_multiplier(char *refparam, struc
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1000", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1000","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -405,7 +405,7 @@ static int set_instance_mode(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, InstanceMode, NULL))
|
||||
if (dm_validate_string(value, -1, -1, InstanceMode, 2, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -471,7 +471,7 @@ static int set_stun_server_address(char *refparam, struct dmctx *ctx, void *data
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -492,7 +492,7 @@ static int set_stun_server_port(char *refparam, struct dmctx *ctx, void *data, c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -513,7 +513,7 @@ static int set_stun_username(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -534,7 +534,7 @@ static int set_stun_password(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -555,7 +555,7 @@ static int set_stun_maximum_keepalive_period(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -576,7 +576,7 @@ static int set_stun_minimum_keepalive_period(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -614,7 +614,7 @@ static int set_management_server_conn_rep_allowed_jabber_id(char *refparam, stru
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, "32", NULL, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, 32, -1, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -664,7 +664,7 @@ static int set_management_server_conn_req_xmpp_connection(char *refparam, struct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ static int set_nat_interface_setting_alias(char *refparam, struct dmctx *ctx, vo
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -246,7 +246,7 @@ static int set_nat_interface_setting_interface(char *refparam, struct dmctx *ctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -315,7 +315,7 @@ static int set_nat_port_mapping_alias(char *refparam, struct dmctx *ctx, void *d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -363,7 +363,7 @@ static int set_nat_port_mapping_interface(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -394,7 +394,7 @@ static int set_nat_port_mapping_remote_host(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -426,7 +426,7 @@ static int set_nat_port_mapping_external_port(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -458,7 +458,7 @@ static int set_nat_port_mapping_external_port_end_range(char *refparam, struct d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -487,7 +487,7 @@ static int set_nat_port_mapping_internal_port(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -515,7 +515,7 @@ static int set_nat_port_mapping_protocol(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NATProtocol, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NATProtocol, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -541,7 +541,7 @@ static int set_nat_port_mapping_internal_client(char *refparam, struct dmctx *ct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -562,7 +562,7 @@ static int set_nat_port_mapping_description(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ static int set_ppp_alias(char *refparam, struct dmctx *ctx, void *data, char *in
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -177,7 +177,7 @@ static int set_ppp_username(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -192,7 +192,7 @@ static int set_ppp_password(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -293,7 +293,7 @@ static int set_ppp_lower_layer(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "1024", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 1024, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -345,7 +345,7 @@ static int set_PPPInterfacePPPoE_ACName(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
|
||||
dmuci_get_value_by_section_string(((struct uci_section *)data), "proto", &proto);
|
||||
|
|
@ -377,7 +377,7 @@ static int set_PPPInterfacePPPoE_ServiceName(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
|
||||
dmuci_get_value_by_section_string(((struct uci_section *)data), "proto", &proto);
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ static int set_ptm_alias(char *refparam, struct dmctx *ctx, void *data, char *in
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ static int set_QoS_DefaultForwardingPolicy(char *refparam, struct dmctx *ctx, vo
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -562,7 +562,7 @@ static int set_QoS_DefaultTrafficClass(char *refparam, struct dmctx *ctx, void *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -582,7 +582,7 @@ static int set_QoS_DefaultPolicer(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -609,7 +609,7 @@ static int set_QoS_DefaultQueue(char *refparam, struct dmctx *ctx, void *data, c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -641,7 +641,7 @@ static int set_QoS_DefaultDSCPMark(char *refparam, struct dmctx *ctx, void *data
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -661,7 +661,7 @@ static int set_QoS_DefaultEthernetPriorityMark(char *refparam, struct dmctx *ctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -681,7 +681,7 @@ static int set_QoS_DefaultInnerEthernetPriorityMark(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -733,7 +733,7 @@ static int set_QoSClassification_Order(char *refparam, struct dmctx *ctx, void *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -756,7 +756,7 @@ static int set_QoSClassification_Alias(char *refparam, struct dmctx *ctx, void *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -776,7 +776,7 @@ static int set_QoSClassification_DHCPType(char *refparam, struct dmctx *ctx, voi
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DHCPType, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DHCPType, 2, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -823,7 +823,7 @@ static int set_QoSClassification_Interface(char *refparam, struct dmctx *ctx, vo
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -867,7 +867,7 @@ static int set_QoSClassification_DestIP(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPAddress))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -887,7 +887,7 @@ static int set_QoSClassification_DestMask(char *refparam, struct dmctx *ctx, voi
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "49", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 49, NULL, 0, IPPrefix, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -931,7 +931,7 @@ static int set_QoSClassification_SourceIP(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPAddress))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -951,7 +951,7 @@ static int set_QoSClassification_SourceMask(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "49", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 49, NULL, 0, IPPrefix, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -994,7 +994,7 @@ static int set_QoSClassification_Protocol(char *refparam, struct dmctx *ctx, voi
|
|||
struct dmmap_dup *p= (struct dmmap_dup*)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "255"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","255"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1038,7 +1038,7 @@ static int set_QoSClassification_DestPort(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "65535"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1062,7 +1062,7 @@ static int set_QoSClassification_DestPortRangeMax(char *refparam, struct dmctx *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "65535"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1106,7 +1106,7 @@ static int set_QoSClassification_SourcePort(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "65535"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1126,7 +1126,7 @@ static int set_QoSClassification_SourcePortRangeMax(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "65535"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1166,7 +1166,7 @@ static int set_QoSClassification_SourceMACAddress(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "17", NULL, MACAddress))
|
||||
if (dm_validate_string(value, -1, 17, NULL, 0, MACAddress, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1186,7 +1186,7 @@ static int set_QoSClassification_SourceMACMask(char *refparam, struct dmctx *ctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "17", NULL, MACAddress))
|
||||
if (dm_validate_string(value, -1, 17, NULL, 0, MACAddress, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1226,7 +1226,7 @@ static int set_QoSClassification_DestMACAddress(char *refparam, struct dmctx *ct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "17", NULL, MACAddress))
|
||||
if (dm_validate_string(value, -1, 17, NULL, 0, MACAddress, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1246,7 +1246,7 @@ static int set_QoSClassification_DestMACMask(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "17", NULL, MACAddress))
|
||||
if (dm_validate_string(value, -1, 17, NULL, 0, MACAddress, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1286,7 +1286,7 @@ static int set_QoSClassification_Ethertype(char *refparam, struct dmctx *ctx, vo
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1326,7 +1326,7 @@ static int set_QoSClassification_SSAP(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1366,7 +1366,7 @@ static int set_QoSClassification_DSAP(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1406,7 +1406,7 @@ static int set_QoSClassification_LLCControl(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1446,7 +1446,7 @@ static int set_QoSClassification_SNAPOUI(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1486,7 +1486,7 @@ static int set_QoSClassification_SourceVendorClassID(char *refparam, struct dmct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "255", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 255, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1506,7 +1506,7 @@ static int set_QoSClassification_SourceVendorClassIDv6(char *refparam, struct dm
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1546,7 +1546,7 @@ static int set_QoSClassification_SourceVendorClassIDMode(char *refparam, struct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, VendorClassIDMode, NULL))
|
||||
if (dm_validate_string(value, -1, -1, VendorClassIDMode, 4, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1566,7 +1566,7 @@ static int set_QoSClassification_DestVendorClassID(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "255", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 255, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1586,7 +1586,7 @@ static int set_QoSClassification_DestVendorClassIDv6(char *refparam, struct dmct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1626,7 +1626,7 @@ static int set_QoSClassification_DestVendorClassIDMode(char *refparam, struct dm
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, VendorClassIDMode, NULL))
|
||||
if (dm_validate_string(value, -1, -1, VendorClassIDMode, 4, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1646,7 +1646,7 @@ static int set_QoSClassification_SourceClientID(char *refparam, struct dmctx *ct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1686,7 +1686,7 @@ static int set_QoSClassification_DestClientID(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1726,7 +1726,7 @@ static int set_QoSClassification_SourceUserClassID(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1766,7 +1766,7 @@ static int set_QoSClassification_DestUserClassID(char *refparam, struct dmctx *c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1806,7 +1806,7 @@ static int set_QoSClassification_SourceVendorSpecificInfo(char *refparam, struct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1846,7 +1846,7 @@ static int set_QoSClassification_SourceVendorSpecificInfoEnterprise(char *refpar
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1866,7 +1866,7 @@ static int set_QoSClassification_SourceVendorSpecificInfoSubOption(char *refpara
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "0", "255"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"0","255"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1886,7 +1886,7 @@ static int set_QoSClassification_DestVendorSpecificInfo(char *refparam, struct d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "65535"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1926,7 +1926,7 @@ static int set_QoSClassification_DestVendorSpecificInfoEnterprise(char *refparam
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1946,7 +1946,7 @@ static int set_QoSClassification_DestVendorSpecificInfoSubOption(char *refparam,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "0", "255"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"0","255"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2006,7 +2006,7 @@ static int set_QoSClassification_IPLengthMin(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2026,7 +2026,7 @@ static int set_QoSClassification_IPLengthMax(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2066,7 +2066,7 @@ static int set_QoSClassification_DSCPCheck(char *refparam, struct dmctx *ctx, vo
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "63"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","63"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2110,7 +2110,7 @@ static int set_QoSClassification_DSCPMark(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2130,7 +2130,7 @@ static int set_QoSClassification_EthernetPriorityCheck(char *refparam, struct dm
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2170,7 +2170,7 @@ static int set_QoSClassification_EthernetPriorityMark(char *refparam, struct dmc
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2190,7 +2190,7 @@ static int set_QoSClassification_InnerEthernetPriorityCheck(char *refparam, stru
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2230,7 +2230,7 @@ static int set_QoSClassification_InnerEthernetPriorityMark(char *refparam, struc
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2250,7 +2250,7 @@ static int set_QoSClassification_EthernetDEICheck(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2290,7 +2290,7 @@ static int set_QoSClassification_VLANIDCheck(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2330,7 +2330,7 @@ static int set_QoSClassification_OutOfBandInfo(char *refparam, struct dmctx *ctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2350,7 +2350,7 @@ static int set_QoSClassification_ForwardingPolicy(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2370,7 +2370,7 @@ static int set_QoSClassification_TrafficClass(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2390,7 +2390,7 @@ static int set_QoSClassification_Policer(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2410,7 +2410,7 @@ static int set_QoSClassification_App(char *refparam, struct dmctx *ctx, void *da
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2456,7 +2456,7 @@ static int set_QoSApp_Alias(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2476,7 +2476,7 @@ static int set_QoSApp_ProtocolIdentifier(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2496,7 +2496,7 @@ static int set_QoSApp_Name(char *refparam, struct dmctx *ctx, void *data, char *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2516,7 +2516,7 @@ static int set_QoSApp_DefaultForwardingPolicy(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2536,7 +2536,7 @@ static int set_QoSApp_DefaultTrafficClass(char *refparam, struct dmctx *ctx, voi
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2556,7 +2556,7 @@ static int set_QoSApp_DefaultPolicer(char *refparam, struct dmctx *ctx, void *da
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2576,7 +2576,7 @@ static int set_QoSApp_DefaultDSCPMark(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2596,7 +2596,7 @@ static int set_QoSApp_DefaultEthernetPriorityMark(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2616,7 +2616,7 @@ static int set_QoSApp_DefaultInnerEthernetPriorityMark(char *refparam, struct dm
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2662,7 +2662,7 @@ static int set_QoSFlow_Alias(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2682,7 +2682,7 @@ static int set_QoSFlow_Type(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2702,7 +2702,7 @@ static int set_QoSFlow_TypeParameters(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2722,7 +2722,7 @@ static int set_QoSFlow_Name(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2742,7 +2742,7 @@ static int set_QoSFlow_App(char *refparam, struct dmctx *ctx, void *data, char *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2762,7 +2762,7 @@ static int set_QoSFlow_ForwardingPolicy(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2782,7 +2782,7 @@ static int set_QoSFlow_TrafficClass(char *refparam, struct dmctx *ctx, void *dat
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2802,7 +2802,7 @@ static int set_QoSFlow_Policer(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2822,7 +2822,7 @@ static int set_QoSFlow_DSCPMark(char *refparam, struct dmctx *ctx, void *data, c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2842,7 +2842,7 @@ static int set_QoSFlow_EthernetPriorityMark(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2862,7 +2862,7 @@ static int set_QoSFlow_InnerEthernetPriorityMark(char *refparam, struct dmctx *c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-2", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-2",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2908,7 +2908,7 @@ static int set_QoSPolicer_Alias(char *refparam, struct dmctx *ctx, void *data, c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2928,7 +2928,7 @@ static int set_QoSPolicer_CommittedRate(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2948,7 +2948,7 @@ static int set_QoSPolicer_CommittedBurstSize(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2968,7 +2968,7 @@ static int set_QoSPolicer_ExcessBurstSize(char *refparam, struct dmctx *ctx, voi
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2988,7 +2988,7 @@ static int set_QoSPolicer_PeakRate(char *refparam, struct dmctx *ctx, void *data
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3008,7 +3008,7 @@ static int set_QoSPolicer_PeakBurstSize(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3028,7 +3028,7 @@ static int set_QoSPolicer_MeterType(char *refparam, struct dmctx *ctx, void *dat
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3054,7 +3054,7 @@ static int set_QoSPolicer_ConformingAction(char *refparam, struct dmctx *ctx, vo
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, ConformingAction))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, ConformingAction, 5))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3074,7 +3074,7 @@ static int set_QoSPolicer_PartialConformingAction(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, ConformingAction))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, ConformingAction, 5))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3094,7 +3094,7 @@ static int set_QoSPolicer_NonConformingAction(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, ConformingAction))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, ConformingAction, 5))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3191,7 +3191,7 @@ static int set_QoSQueue_Alias(char *refparam, struct dmctx *ctx, void *data, cha
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3211,7 +3211,7 @@ static int set_QoSQueue_TrafficClasses(char *refparam, struct dmctx *ctx, void *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt_list(value, NULL, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_unsignedInt_list(value, -1, -1, 256, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3257,7 +3257,7 @@ static int set_QoSQueue_Interface(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3311,7 +3311,7 @@ static int set_QoSQueue_Weight(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3331,7 +3331,7 @@ static int set_QoSQueue_Precedence(char *refparam, struct dmctx *ctx, void *data
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3351,7 +3351,7 @@ static int set_QoSQueue_REDThreshold(char *refparam, struct dmctx *ctx, void *da
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, "100"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,"100"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3371,7 +3371,7 @@ static int set_QoSQueue_REDPercentage(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, "100"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,"100"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3391,7 +3391,7 @@ static int set_QoSQueue_DropAlgorithm(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DropAlgorithm, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DropAlgorithm, 4, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3411,7 +3411,7 @@ static int set_QoSQueue_SchedulerAlgorithm(char *refparam, struct dmctx *ctx, vo
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, SchedulerAlgorithm, NULL))
|
||||
if (dm_validate_string(value, -1, -1, SchedulerAlgorithm, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3441,7 +3441,7 @@ static int set_QoSQueue_ShapingRate(char *refparam, struct dmctx *ctx, void *dat
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3465,7 +3465,7 @@ static int set_QoSQueue_ShapingBurstSize(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3514,7 +3514,7 @@ static int set_QoSQueueStats_Alias(char *refparam, struct dmctx *ctx, void *data
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3534,7 +3534,7 @@ static int set_QoSQueueStats_Queue(char *refparam, struct dmctx *ctx, void *data
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3564,7 +3564,7 @@ static int set_QoSQueueStats_Interface(char *refparam, struct dmctx *ctx, void *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3652,7 +3652,7 @@ static int set_QoSShaper_Alias(char *refparam, struct dmctx *ctx, void *data, ch
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3698,7 +3698,7 @@ static int set_QoSShaper_Interface(char *refparam, struct dmctx *ctx, void *data
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3727,7 +3727,7 @@ static int set_QoSShaper_ShapingRate(char *refparam, struct dmctx *ctx, void *da
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -3751,7 +3751,7 @@ static int set_QoSShaper_ShapingBurstSize(char *refparam, struct dmctx *ctx, voi
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -555,7 +555,7 @@ static int set_router_ipv4forwarding_destip(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string(value, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -579,7 +579,7 @@ static int set_router_ipv4forwarding_destmask(char *refparam, struct dmctx *ctx,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string(value, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -626,7 +626,7 @@ static int set_router_ipv4forwarding_gatewayip(char *refparam, struct dmctx *ctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "15", NULL, IPv4Address))
|
||||
if (dm_validate_string(value, -1, 15, NULL, 0, IPv4Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -656,7 +656,7 @@ static int set_router_ipv4forwarding_interface_linker_parameter(char *refparam,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -684,7 +684,7 @@ static int set_router_ipv4forwarding_metric(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -733,7 +733,7 @@ static int set_RoutingRouterIPv6Forwarding_DestIPPrefix(char *refparam, struct d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "49", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 49, NULL, 0, IPv6Prefix, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -753,7 +753,7 @@ static int set_RoutingRouterIPv6Forwarding_ForwardingPolicy(char *refparam, stru
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -776,7 +776,7 @@ static int set_RoutingRouterIPv6Forwarding_NextHop(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPv6Address))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPv6Address, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -806,7 +806,7 @@ static int set_RoutingRouterIPv6Forwarding_Interface(char *refparam, struct dmct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -841,7 +841,7 @@ static int set_RoutingRouterIPv6Forwarding_ForwardingMetric(char *refparam, stru
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", NULL))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1008,7 +1008,7 @@ static int set_RoutingRouter_Alias(char *refparam, struct dmctx *ctx, void *data
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1039,7 +1039,7 @@ static int set_router_ipv4forwarding_alias(char *refparam, struct dmctx *ctx, vo
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1075,7 +1075,7 @@ static int set_RoutingRouterIPv6Forwarding_Alias(char *refparam, struct dmctx *c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ static int get_SecurityCertificate_SerialNumber(char *refparam, struct dmctx *ct
|
|||
#ifdef LOPENSSL
|
||||
struct certificate_profile *cert_profile = (struct certificate_profile*)data;
|
||||
ASN1_INTEGER *serial = X509_get_serialNumber(cert_profile->openssl_cert);
|
||||
*value = stringToHex(serial->data, serial->length);
|
||||
*value = stringToHex((char *)serial->data, serial->length);
|
||||
#elif LMBEDTLS
|
||||
struct certificate_profile *cert_profile = (struct certificate_profile*)data;
|
||||
*value = stringToHex(cert_profile->mbdtls_cert.serial.p, cert_profile->mbdtls_cert.serial.len);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ static int set_time_LocalTimeZone(char *refparam, struct dmctx *ctx, void *data,
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -189,7 +189,7 @@ static int set_time_ntpserver(char *refparam, struct dmctx *ctx, int action, cha
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -489,7 +489,7 @@ static int set_USBInterface_Alias(char *refparam, struct dmctx *ctx, void *data,
|
|||
struct usb_interface *usbiface= (struct usb_interface *)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -518,7 +518,7 @@ static int set_USBInterface_LowerLayers(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "1024", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 1024, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -594,7 +594,7 @@ static int set_USBPort_Alias(char *refparam, struct dmctx *ctx, void *data, char
|
|||
struct usb_port* port = (struct usb_port *)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -696,7 +696,7 @@ static int set_USBUSBHostsHost_Alias(char *refparam, struct dmctx *ctx, void *da
|
|||
struct usb_port* port=(struct usb_port *)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ static int set_userint_remoteaccesss_port(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,"65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -170,7 +170,7 @@ static int set_userint_remoteaccesss_protocol(char *refparam, struct dmctx *ctx,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, SupportedProtocols, NULL))
|
||||
if (dm_validate_string(value, -1, -1, SupportedProtocols, 2, NULL, 0))
|
||||
return FAULT_9007;
|
||||
|
||||
found = get_supportedprotocols();
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ static int set_user_alias(char *refparam, struct dmctx *ctx, void *data, char *i
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -183,7 +183,7 @@ static int set_user_username(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -197,7 +197,7 @@ static int set_user_password(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -225,7 +225,7 @@ static int set_user_language(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "16", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 16, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ static int set_wlan_ssid(char *refparam, struct dmctx *ctx, void *data, char *in
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "32", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 32, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -334,7 +334,7 @@ static int set_WiFiRadio_LowerLayers(char *refparam, struct dmctx *ctx, void *da
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "1024", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 1024, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -461,7 +461,7 @@ static int set_radio_operating_standard(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, -1, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -522,7 +522,7 @@ static int set_WiFiRadio_AutoChannelRefreshPeriod(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -550,7 +550,7 @@ static int set_WiFiRadio_FragmentationThreshold(char *refparam, struct dmctx *ct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -571,7 +571,7 @@ static int set_WiFiRadio_RTSThreshold(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -592,7 +592,7 @@ static int set_WiFiRadio_BeaconPeriod(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -613,7 +613,7 @@ static int set_WiFiRadio_DTIMPeriod(char *refparam, struct dmctx *ctx, void *dat
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -654,7 +654,7 @@ static int set_WiFiRadio_OperatingChannelBandwidth(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -694,7 +694,7 @@ static int set_WiFiRadio_PreambleType(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, PreambleType, NULL))
|
||||
if (dm_validate_string(value, -1, -1, PreambleType, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -747,7 +747,7 @@ static int set_WiFiRadio_TransmitPower(char *refparam, struct dmctx *ctx, void *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_int(value, "-1", "100"))
|
||||
if (dm_validate_int(value, RANGE_ARGS{{"-1","100"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -780,7 +780,7 @@ static int set_WiFiRadio_RegulatoryDomain(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, "3", "3", NULL, RegulatoryDomain))
|
||||
if (dm_validate_string(value, 3, 3, NULL, 0, RegulatoryDomain, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -816,7 +816,7 @@ static int set_radio_channel(char *refparam, struct dmctx *ctx, void *data, char
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "255"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","255"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1284,7 +1284,7 @@ static int set_access_point_maxassoc(char *refparam, struct dmctx *ctx, void *da
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1330,7 +1330,7 @@ static int set_WiFiAccessPoint_MaxAllowedAssociations(char *refparam, struct dmc
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1384,7 +1384,7 @@ static int set_WiFiAccessPoint_AllowedMACAddress(char *refparam, struct dmctx *c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, NULL, NULL, "17", NULL, MACAddress))
|
||||
if (dm_validate_string_list(value, -1, -1, -1, -1, 17, NULL, 0, MACAddress, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1497,7 +1497,7 @@ static int set_access_point_security_modes(char *refparam, struct dmctx *ctx, vo
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1585,7 +1585,7 @@ static int set_access_point_security_wepkey(char *refparam, struct dmctx *ctx, v
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, "13", "13"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{"5","5"},{"13","13"}}, 2))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1632,7 +1632,7 @@ static int set_access_point_security_shared_key(char *refparam, struct dmctx *ct
|
|||
char *encryption;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "32"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"32"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1651,7 +1651,7 @@ static int set_access_point_security_passphrase(char *refparam, struct dmctx *ct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, "8", "63", NULL, NULL))
|
||||
if (dm_validate_string(value, 8, 63, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1677,7 +1677,7 @@ static int set_access_point_security_rekey_interval(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1705,7 +1705,7 @@ static int set_access_point_security_radius_ip_address(char *refparam, struct dm
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPAddress))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1730,7 +1730,7 @@ static int set_access_point_security_radius_server_port(char *refparam, struct d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1748,7 +1748,7 @@ static int set_access_point_security_radius_secret(char *refparam, struct dmctx
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -1771,7 +1771,7 @@ static int set_WiFiAccessPointSecurity_MFPConfig(char *refparam, struct dmctx *c
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, MFPConfig, NULL))
|
||||
if (dm_validate_string(value, -1, -1, MFPConfig, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1852,7 +1852,7 @@ static int set_WiFiAccessPointWPS_ConfigMethodsEnabled(char *refparam, struct dm
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, -1, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1884,7 +1884,7 @@ static int set_WiFiAccessPointWPS_PIN(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "8", NULL, PIN))
|
||||
if (dm_validate_string(value, -1, 8, NULL, 0, PIN, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1905,7 +1905,7 @@ static int set_WiFiAccessPointAccounting_ServerIPAddr(char *refparam, struct dmc
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "45", NULL, IPAddress))
|
||||
if (dm_validate_string(value, -1, 45, NULL, 0, IPAddress, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1926,7 +1926,7 @@ static int set_WiFiAccessPointAccounting_ServerPort(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -1947,7 +1947,7 @@ static int set_WiFiAccessPointAccounting_Secret(char *refparam, struct dmctx *ct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2099,7 +2099,7 @@ static int set_WiFiEndPoint_Alias(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2165,7 +2165,7 @@ static int set_WiFiEndPointProfile_Alias(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2191,7 +2191,7 @@ static int set_WiFiEndPointProfile_SSID(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "32", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 32, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2227,7 +2227,7 @@ static int set_WiFiEndPointProfileSecurity_ModeEnabled(char *refparam, struct dm
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string(value, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2316,7 +2316,7 @@ static int set_WiFiEndPointProfileSecurity_WEPKey(char *refparam, struct dmctx *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, "13", "13"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{"5","5"},{"13","13"}}, 2))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2337,7 +2337,7 @@ static int set_WiFiEndPointProfileSecurity_PreSharedKey(char *refparam, struct d
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_hexBinary(value, NULL, "32"))
|
||||
if (dm_validate_hexBinary(value, RANGE_ARGS{{NULL,"32"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2356,7 +2356,7 @@ static int set_WiFiEndPointProfileSecurity_KeyPassphrase(char *refparam, struct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, "8", "63", NULL, NULL))
|
||||
if (dm_validate_string(value, 8, 63, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2380,7 +2380,7 @@ static int set_WiFiEndPointProfileSecurity_MFPConfig(char *refparam, struct dmct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, MFPConfig, NULL))
|
||||
if (dm_validate_string(value, -1, -1, MFPConfig, 3, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2461,7 +2461,7 @@ static int set_WiFiEndPointWPS_ConfigMethodsEnabled(char *refparam, struct dmctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, NULL, NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, -1, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2494,7 +2494,7 @@ static int set_WiFiEndPointWPS_PIN(char *refparam, struct dmctx *ctx, void *data
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "8", "8"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"4","4"},{"8","8"}}, 2))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
|
|
@ -2530,7 +2530,7 @@ static int set_neighboring_wifi_diagnostics_diagnostics_state(char *refparam, st
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, DiagnosticsState, NULL))
|
||||
if (dm_validate_string(value, -1, -1, DiagnosticsState, 5, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2625,7 +2625,7 @@ static int set_radio_alias(char *refparam, struct dmctx *ctx, void *data, char *
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2653,7 +2653,7 @@ static int set_ssid_alias(char *refparam, struct dmctx *ctx, void *data, char *i
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2681,7 +2681,7 @@ static int set_access_point_alias(char *refparam, struct dmctx *ctx, void *data,
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -2711,7 +2711,7 @@ static int set_ssid_lower_layer(char *refparam, struct dmctx *ctx, void *data, c
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, NULL, NULL, "1024", NULL, NULL, NULL, NULL))
|
||||
if (dm_validate_string_list(value, -1, -1, 1024, -1, -1, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ static int set_x_iopsys_eu_button_alias(char *refparam, struct dmctx *ctx, void
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -334,7 +334,7 @@ static int set_x_iopsys_eu_dropbear_alias(char *refparam, struct dmctx *ctx, voi
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -612,7 +612,7 @@ static int set_x_iopsys_eu_cfgobj_address_alias(char *refparam, struct dmctx *ct
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -642,7 +642,7 @@ static int set_port_forwarding_alias(char *refparam, struct dmctx *ctx, void *da
|
|||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ static int set_xmpp_connection_alias(char *refparam, struct dmctx *ctx, void *da
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -149,7 +149,7 @@ static int set_xmpp_connection_username(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -170,7 +170,7 @@ static int set_xmpp_connection_password(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -191,7 +191,7 @@ static int set_xmpp_connection_domain(char *refparam, struct dmctx *ctx, void *d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -212,7 +212,7 @@ static int set_xmpp_connection_resource(char *refparam, struct dmctx *ctx, void
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -233,7 +233,7 @@ static int set_xmpp_connection_server_connect_algorithm(char *refparam, struct d
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, NULL, NULL, ServerConnectAlgorithm))
|
||||
if (dm_validate_string(value, -1, -1, ServerConnectAlgorithm, 4, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -254,7 +254,7 @@ static int set_xmpp_connection_keepalive_interval(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_long(value, "-1", NULL))
|
||||
if (dm_validate_long(value, RANGE_ARGS{{"-1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -275,7 +275,7 @@ static int set_xmpp_connection_server_attempts(char *refparam, struct dmctx *ctx
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, NULL, NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{NULL,NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -296,7 +296,7 @@ static int set_xmpp_connection_retry_initial_interval(char *refparam, struct dmc
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -317,7 +317,7 @@ static int set_xmpp_connection_retry_interval_multiplier(char *refparam, struct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1000", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1000","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -338,7 +338,7 @@ static int set_xmpp_connection_retry_max_interval(char *refparam, struct dmctx *
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "1", NULL))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"1",NULL}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -440,7 +440,7 @@ static int set_xmpp_connection_server_alias(char *refparam, struct dmctx *ctx, v
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "64", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -461,7 +461,7 @@ static int set_xmpp_connection_server_server_address(char *refparam, struct dmct
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, NULL, "256", NULL, NULL))
|
||||
if (dm_validate_string(value, -1, 256, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
@ -482,7 +482,7 @@ static int set_xmpp_connection_server_port(char *refparam, struct dmctx *ctx, vo
|
|||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_unsignedInt(value, "0", "65535"))
|
||||
if (dm_validate_unsignedInt(value, RANGE_ARGS{{"0","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
|
|
|
|||
|
|
@ -159,9 +159,9 @@ def get_mapping_obj( mappingobj ):
|
|||
|
||||
def generate_validate_value(dmparam, value):
|
||||
validate_value = ""
|
||||
maxsizeparam = "NULL"
|
||||
itemminparam = "NULL"
|
||||
itemmaxparam = "NULL"
|
||||
maxsizeparam = "-1"
|
||||
itemminparam = "-1"
|
||||
itemmaxparam = "-1"
|
||||
rangeminparam = "NULL"
|
||||
rangemaxparam = "NULL"
|
||||
|
||||
|
|
@ -169,106 +169,158 @@ def generate_validate_value(dmparam, value):
|
|||
if listparam != None:
|
||||
datatypeparam = getoptionparam(listparam, "datatype")
|
||||
maxsizeparam = getoptionparam(listparam, "maxsize")
|
||||
if maxsizeparam == None: maxsizeparam = "NULL"
|
||||
if maxsizeparam == None: maxsizeparam = "-1"
|
||||
itemparam = getoptionparam(listparam, "item")
|
||||
if itemparam != None:
|
||||
itemminparam = getoptionparam(itemparam, "min")
|
||||
if itemminparam == None: itemminparam = "NULL"
|
||||
if itemminparam == None: itemminparam = "-1"
|
||||
itemmaxparam = getoptionparam(itemparam, "max")
|
||||
if itemmaxparam == None: itemmaxparam = "NULL"
|
||||
rangeparam = getoptionparam(listparam, "range")
|
||||
if itemmaxparam == None: itemmaxparam = "-1"
|
||||
|
||||
rangeparam = getarrayoptionparam(listparam, "range")
|
||||
if rangeparam != None:
|
||||
rangeminparam = getoptionparam(rangeparam, "min")
|
||||
range_length = len(rangeparam)
|
||||
rangeargs = "RANGE_ARGS{"
|
||||
for i in range(range_length - 1):
|
||||
rangeminparam = getoptionparam(rangeparam[i], "min")
|
||||
if rangeminparam == None: rangeminparam = "NULL"
|
||||
rangemaxparam = getoptionparam(rangeparam[i], "max")
|
||||
if rangemaxparam == None: rangemaxparam = "NULL"
|
||||
rangeargs += "{\"%s\",\"%s\"}," % (rangeminparam, rangemaxparam)
|
||||
rangeminparam = getoptionparam(rangeparam[range_length - 1], "min")
|
||||
if rangeminparam == None: rangeminparam = "NULL"
|
||||
rangemaxparam = getoptionparam(rangeparam, "max")
|
||||
rangemaxparam = getoptionparam(rangeparam[range_length - 1], "max")
|
||||
if rangemaxparam == None: rangemaxparam = "NULL"
|
||||
rangeargs += "{\"%s\",\"%s\"}}, %s" % (rangeminparam, rangemaxparam, range_length)
|
||||
else:
|
||||
rangeargs = "RANGE_ARGS{{NULL,NULL}}, 1"
|
||||
|
||||
enumarationsparam = getarrayoptionparam(listparam, "enumerations")
|
||||
if enumarationsparam != None:
|
||||
list_enumarationsparam = enumarationsparam
|
||||
enum_length = len(list_enumarationsparam)
|
||||
enumarationsparam = dmparam if datatypeparam == "string" else datatypeparam
|
||||
str_enum = "char *%s[] = {" % enumarationsparam
|
||||
for i in range(enum_length):
|
||||
for i in range(enum_length - 1):
|
||||
str_enum += "\"%s\", " % list_enumarationsparam[i]
|
||||
str_enum += "NULL};"
|
||||
str_enum += "\"%s\"};" % list_enumarationsparam[enum_length - 1]
|
||||
printGlobalstrCommon(str_enum)
|
||||
else:
|
||||
enumarationsparam = "NULL"
|
||||
enum_length = "0"
|
||||
|
||||
patternparam = getarrayoptionparam(listparam, "pattern")
|
||||
if patternparam != None:
|
||||
list_patternparam = patternparam
|
||||
pattern_length = len(list_patternparam)
|
||||
patternparam = dmparam if datatypeparam == "string" else datatypeparam
|
||||
str_pattern = "char *%s[] = {" % patternparam
|
||||
for i in range(pattern_length):
|
||||
for i in range(pattern_length - 1):
|
||||
str_pattern += "\"^%s$\", " % list_patternparam[i]
|
||||
str_pattern += "NULL};"
|
||||
str_pattern += "\"^%s$\"};" % list_patternparam[pattern_length - 1]
|
||||
printGlobalstrCommon(str_pattern)
|
||||
elif datatypeparam == "IPAddress":
|
||||
patternparam = "IPAddress"
|
||||
pattern_length = "2"
|
||||
elif datatypeparam == "IPv6Address":
|
||||
patternparam = "IPv6Address"
|
||||
pattern_length = "1"
|
||||
elif datatypeparam == "IPPrefix":
|
||||
patternparam = "IPPrefix"
|
||||
pattern_length = "3"
|
||||
elif datatypeparam == "IPv6Prefix":
|
||||
patternparam = "IPv6Prefix"
|
||||
pattern_length = "1"
|
||||
else:
|
||||
patternparam = "NULL"
|
||||
pattern_length = "0"
|
||||
|
||||
if datatypeparam == "unsignedInt":
|
||||
validate_value += " if (dm_validate_unsignedInt_list(value, \"%s\", \"%s\", \"%s\", \"%s\", \"%s\"))\n" % (itemminparam, itemmaxparam, maxsizeparam, rangeminparam, rangemaxparam)
|
||||
elif datatypeparam == "int":
|
||||
validate_value += " if (dm_validate_int_list(value, \"%s\", \"%s\", \"%s\", \"%s\", \"%s\"))\n" % (itemminparam, itemmaxparam, maxsizeparam, rangeminparam, rangemaxparam)
|
||||
validate_value += " if (dm_validate_unsignedInt_list(value, %s, %s, %s, %s))\n" % (itemminparam, itemmaxparam, maxsizeparam, rangeargs)
|
||||
else:
|
||||
validate_value += " if (dm_validate_string_list(value, \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", %s, %s))\n" % (itemminparam, itemmaxparam, maxsizeparam, rangeminparam, rangemaxparam, enumarationsparam, patternparam)
|
||||
if rangeminparam == "NULL": rangeminparam = "-1"
|
||||
if rangemaxparam == "NULL": rangemaxparam = "-1"
|
||||
validate_value += " if (dm_validate_string_list(value, %s, %s, %s, %s, %s, %s, %s, %s, %s))\n" % (itemminparam, itemmaxparam, maxsizeparam, rangeminparam, rangemaxparam, enumarationsparam, enum_length, patternparam, pattern_length)
|
||||
else:
|
||||
datatypeparam = getoptionparam(value, "datatype")
|
||||
rangeparam = getoptionparam(value, "range")
|
||||
rangeparam = getarrayoptionparam(value, "range")
|
||||
if rangeparam != None:
|
||||
rangeminparam = getoptionparam(rangeparam, "min")
|
||||
range_length = len(rangeparam)
|
||||
rangeargs = "RANGE_ARGS{"
|
||||
for i in range(range_length - 1):
|
||||
rangeminparam = getoptionparam(rangeparam[i], "min")
|
||||
if rangeminparam == None: rangeminparam = "NULL"
|
||||
rangemaxparam = getoptionparam(rangeparam[i], "max")
|
||||
if rangemaxparam == None: rangemaxparam = "NULL"
|
||||
rangeargs += "{\"%s\",\"%s\"}," % (rangeminparam, rangemaxparam)
|
||||
rangeminparam = getoptionparam(rangeparam[range_length - 1], "min")
|
||||
if rangeminparam == None: rangeminparam = "NULL"
|
||||
rangemaxparam = getoptionparam(rangeparam, "max")
|
||||
rangemaxparam = getoptionparam(rangeparam[range_length - 1], "max")
|
||||
if rangemaxparam == None: rangemaxparam = "NULL"
|
||||
rangeargs += "{\"%s\",\"%s\"}}, %s" % (rangeminparam, rangemaxparam, range_length)
|
||||
else:
|
||||
rangeargs = "RANGE_ARGS{{NULL,NULL}}, 1"
|
||||
|
||||
enumarationsparam = getarrayoptionparam(value, "enumerations")
|
||||
if enumarationsparam != None:
|
||||
list_enumarationsparam = enumarationsparam
|
||||
enum_length = len(list_enumarationsparam)
|
||||
enumarationsparam = dmparam if datatypeparam == "string" else datatypeparam
|
||||
str_enum = "char *%s[] = {" % enumarationsparam
|
||||
for i in range(enum_length):
|
||||
for i in range(enum_length - 1):
|
||||
str_enum += "\"%s\", " % list_enumarationsparam[i]
|
||||
|
||||
str_enum += "NULL};"
|
||||
str_enum += "\"%s\"};" % list_enumarationsparam[enum_length - 1]
|
||||
printGlobalstrCommon(str_enum)
|
||||
else:
|
||||
enumarationsparam = "NULL"
|
||||
enum_length = "0"
|
||||
|
||||
patternparam = getarrayoptionparam(value, "pattern")
|
||||
if patternparam != None:
|
||||
list_patternparam = patternparam
|
||||
pattern_length = len(list_patternparam)
|
||||
patternparam = dmparam if datatypeparam == "string" else datatypeparam
|
||||
str_pattern = "char *%s[] = {" % patternparam
|
||||
for i in range(pattern_length):
|
||||
for i in range(pattern_length - 1):
|
||||
str_pattern += "\"^%s$\", " % list_patternparam[i]
|
||||
str_pattern += "NULL};"
|
||||
str_pattern += "\"^%s$\"};" % list_patternparam[pattern_length - 1]
|
||||
printGlobalstrCommon(str_pattern)
|
||||
elif datatypeparam == "IPAddress":
|
||||
patternparam = "IPAddress"
|
||||
pattern_length = "2"
|
||||
elif datatypeparam == "IPv6Address":
|
||||
patternparam = "IPv6Address"
|
||||
pattern_length = "1"
|
||||
elif datatypeparam == "IPPrefix":
|
||||
patternparam = "IPPrefix"
|
||||
pattern_length = "3"
|
||||
elif datatypeparam == "IPv6Prefix":
|
||||
patternparam = "IPv6Prefix"
|
||||
pattern_length = "1"
|
||||
else:
|
||||
patternparam = "NULL"
|
||||
pattern_length = "0"
|
||||
|
||||
if datatypeparam == "boolean":
|
||||
validate_value += " if (dm_validate_boolean(value))\n"
|
||||
elif datatypeparam == "unsignedInt":
|
||||
validate_value += " if (dm_validate_unsignedInt(value, \"%s\", \"%s\"))\n" % (rangeminparam, rangemaxparam)
|
||||
validate_value += " if (dm_validate_unsignedInt(value, %s))\n" % rangeargs
|
||||
elif datatypeparam == "int":
|
||||
validate_value += " if (dm_validate_int(value, \"%s\", \"%s\"))\n" % (rangeminparam, rangemaxparam)
|
||||
validate_value += " if (dm_validate_int(value, %s))\n" % rangeargs
|
||||
elif datatypeparam == "unsignedLong":
|
||||
validate_value += " if (dm_validate_unsignedLong(value, \"%s\", \"%s\"))\n" % (rangeminparam, rangemaxparam)
|
||||
validate_value += " if (dm_validate_unsignedLong(value, %s))\n" % rangeargs
|
||||
elif datatypeparam == "long":
|
||||
validate_value += " if (dm_validate_long(value, \"%s\", \"%s\"))\n" % (rangeminparam, rangemaxparam)
|
||||
validate_value += " if (dm_validate_long(value, %s))\n" % rangeargs
|
||||
elif datatypeparam == "dateTime":
|
||||
validate_value += " if (dm_validate_dateTime(value))\n"
|
||||
elif datatypeparam == "hexBinary":
|
||||
validate_value += " if (dm_validate_hexBinary(value, \"%s\", \"%s\"))\n" % (rangeminparam, rangemaxparam)
|
||||
if rangeminparam == "NULL": rangeminparam = "-1"
|
||||
if rangemaxparam == "NULL": rangemaxparam = "-1"
|
||||
validate_value += " if (dm_validate_hexBinary(value, %s))\n" % rangeargs
|
||||
else:
|
||||
validate_value += " if (dm_validate_string(value, \"%s\", \"%s\", %s, %s))\n" % (rangeminparam, rangemaxparam, enumarationsparam, patternparam)
|
||||
if rangeminparam == "NULL": rangeminparam = "-1"
|
||||
if rangemaxparam == "NULL": rangemaxparam = "-1"
|
||||
validate_value += " if (dm_validate_string(value, %s, %s, %s, %s, %s, %s))\n" % (rangeminparam, rangemaxparam, enumarationsparam, enum_length, patternparam, pattern_length)
|
||||
validate_value += " return FAULT_9007;"
|
||||
validate_value = validate_value.replace("\"NULL\"", "NULL")
|
||||
return validate_value
|
||||
|
|
|
|||
1460
json/tr104.json
1460
json/tr104.json
File diff suppressed because it is too large
Load diff
13966
json/tr181.json
13966
json/tr181.json
File diff suppressed because it is too large
Load diff
|
|
@ -133,7 +133,7 @@ char *DMT_TYPE[] = {
|
|||
[DMT_LONG] = "xsd:long",
|
||||
[DMT_BOOL] = "xsd:boolean",
|
||||
[DMT_TIME] = "xsd:dateTime",
|
||||
[DMT_HEXBIN] = "xsd:hexbin",
|
||||
[DMT_HEXBIN] = "xsd:hexBinary",
|
||||
};
|
||||
|
||||
#ifdef BBF_TR064
|
||||
|
|
|
|||
|
|
@ -23,47 +23,50 @@ char *array_notifcation_char[__MAX_notification] = {
|
|||
[notification_passive_active_lw] = "6",
|
||||
};
|
||||
|
||||
char *Encapsulation[] = {"LLC", "VCMUX", NULL};
|
||||
char *LinkType[] = {"EoA", "IPoA", "PPPoA", "CIP", "Unconfigured", NULL};
|
||||
char *BridgeStandard[] = {"802.1D-2004", "802.1Q-2005", "802.1Q-2011", NULL};
|
||||
char *BridgeType[] = {"ProviderNetworkPort", "CustomerNetworkPort", "CustomerEdgePort", "CustomerVLANPort", "VLANUnawarePort", NULL};
|
||||
char *VendorClassIDMode[] = {"Exact", "Prefix", "Suffix", "Substring", NULL};
|
||||
char *DiagnosticsState[] = {"None", "Requested", "Canceled", "Complete", "Error", NULL};
|
||||
char *SupportedProtocols[] = {"HTTP", "HTTPS", NULL};
|
||||
char *InstanceMode[] = {"InstanceNumber", "InstanceAlias", NULL};
|
||||
char *NATProtocol[] = {"TCP", "UDP", "TCP/UDP", NULL};
|
||||
char *Config[] = {"High", "Low", "Off", "Advanced", NULL};
|
||||
char *Target[] = {"Drop", "Accept", "Reject", "Return", "TargetChain", NULL};
|
||||
char *ServerConnectAlgorithm[] = {"DNS-SRV", "DNS", "ServerTable", "WebSocket", NULL};
|
||||
char *KeepAlivePolicy[] = {"ICMP", "None", NULL};
|
||||
char *DeliveryHeaderProtocol[] = {"IPv4", "IPv6", NULL};
|
||||
char *KeyIdentifierGenerationPolicy[] = {"Disabled", "Provisioned", "CPE_Generated", NULL};
|
||||
char *PreambleType[] = {"short", "long", "auto", NULL};
|
||||
char *MFPConfig[] = {"Disabled", "Optional", "Required", NULL};
|
||||
char *DuplexMode[] = {"Half", "Full", "Auto", NULL};
|
||||
char *RequestedState[] = {"Idle", "Active", NULL};
|
||||
char *BulkDataProtocols[] = {"Streaming", "File", "HTTP", NULL};
|
||||
char *EncodingTypes[] = {"XML", "XDR", "CSV", "JSON", NULL};
|
||||
char *CSVReportFormat[] = {"ParameterPerRow", "ParameterPerColumn", NULL};
|
||||
char *RowTimestamp[] = {"Unix-Epoch", "ISO-8601", "None", NULL};
|
||||
char *JSONReportFormat[] = {"ObjectHierarchy", "NameValuePair", NULL};
|
||||
char *StaticType[] = {"Static", "Inapplicable", "PrefixDelegation", "Child", NULL};
|
||||
char *ProtocolVersion[] = {"Any", "IPv4", "IPv6", NULL};
|
||||
char *ServerSelectionProtocol[] = {"ICMP", "UDP Echo", NULL};
|
||||
char *DHCPType[] = {"DHCPv4", "DHCPv6", NULL};
|
||||
char *DropAlgorithm[] = {"RED", "DT", "WRED", "BLUE", NULL};
|
||||
char *SchedulerAlgorithm[] = {"WFQ", "WRR", "SP", NULL};
|
||||
char *DTMFMethod[] = {"InBand", "RFC2833", "SIPInfo", NULL};
|
||||
char *ProfileEnable[] = {"Disabled", "Quiescent", "Enabled", NULL};
|
||||
char *Encapsulation[] = {"LLC", "VCMUX"};
|
||||
char *LinkType[] = {"EoA", "IPoA", "PPPoA", "CIP", "Unconfigured"};
|
||||
char *BridgeStandard[] = {"802.1D-2004", "802.1Q-2005", "802.1Q-2011"};
|
||||
char *BridgeType[] = {"ProviderNetworkPort", "CustomerNetworkPort", "CustomerEdgePort", "CustomerVLANPort", "VLANUnawarePort"};
|
||||
char *VendorClassIDMode[] = {"Exact", "Prefix", "Suffix", "Substring"};
|
||||
char *DiagnosticsState[] = {"None", "Requested", "Canceled", "Complete", "Error"};
|
||||
char *SupportedProtocols[] = {"HTTP", "HTTPS"};
|
||||
char *InstanceMode[] = {"InstanceNumber", "InstanceAlias"};
|
||||
char *NATProtocol[] = {"TCP", "UDP", "TCP/UDP"};
|
||||
char *Config[] = {"High", "Low", "Off", "Advanced"};
|
||||
char *Target[] = {"Drop", "Accept", "Reject", "Return", "TargetChain"};
|
||||
char *ServerConnectAlgorithm[] = {"DNS-SRV", "DNS", "ServerTable", "WebSocket"};
|
||||
char *KeepAlivePolicy[] = {"ICMP", "None"};
|
||||
char *DeliveryHeaderProtocol[] = {"IPv4", "IPv6"};
|
||||
char *KeyIdentifierGenerationPolicy[] = {"Disabled", "Provisioned", "CPE_Generated"};
|
||||
char *PreambleType[] = {"short", "long", "auto"};
|
||||
char *MFPConfig[] = {"Disabled", "Optional", "Required"};
|
||||
char *DuplexMode[] = {"Half", "Full", "Auto"};
|
||||
char *RequestedState[] = {"Idle", "Active"};
|
||||
char *BulkDataProtocols[] = {"Streaming", "File", "HTTP"};
|
||||
char *EncodingTypes[] = {"XML", "XDR", "CSV", "JSON"};
|
||||
char *CSVReportFormat[] = {"ParameterPerRow", "ParameterPerColumn"};
|
||||
char *RowTimestamp[] = {"Unix-Epoch", "ISO-8601", "None"};
|
||||
char *JSONReportFormat[] = {"ObjectHierarchy", "NameValuePair"};
|
||||
char *StaticType[] = {"Static", "Inapplicable", "PrefixDelegation", "Child"};
|
||||
char *ProtocolVersion[] = {"Any", "IPv4", "IPv6"};
|
||||
char *ServerSelectionProtocol[] = {"ICMP", "UDP Echo"};
|
||||
char *DHCPType[] = {"DHCPv4", "DHCPv6"};
|
||||
char *DropAlgorithm[] = {"RED", "DT", "WRED", "BLUE"};
|
||||
char *SchedulerAlgorithm[] = {"WFQ", "WRR", "SP"};
|
||||
char *DTMFMethod[] = {"InBand", "RFC2833", "SIPInfo"};
|
||||
char *ProfileEnable[] = {"Disabled", "Quiescent", "Enabled"};
|
||||
|
||||
char *PIN[] = {"^\\d{4}|\\d{8}$", NULL};
|
||||
char *DestinationAddress[] = {"^\\d+/\\d+$", NULL};
|
||||
char *RegulatoryDomain[] = {"^[A-Z][A-Z][ OI]$", NULL};
|
||||
char *ConformingAction[] = {"^Null$", "^Drop$", "^[0-9]|[1-5][0-9]|6[0-3]$", "^:[0-7]$", "^([0-9]|[1-5][0-9]|6[0-3]):[0-7]$", NULL};
|
||||
char *IPv4Address[] = {"^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$", NULL};
|
||||
char *IPv6Address[] = {"^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$", NULL};
|
||||
char *IPAddress[] = {"^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$", "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$", NULL};
|
||||
char *MACAddress[] = {"^([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])$", NULL};
|
||||
char *PIN[] = {"^\\d{4}|\\d{8}$"};
|
||||
char *DestinationAddress[] = {"^\\d+/\\d+$"};
|
||||
char *RegulatoryDomain[] = {"^[A-Z][A-Z][ OI]$"};
|
||||
char *ConformingAction[] = {"^Null$", "^Drop$", "^[0-9]|[1-5][0-9]|6[0-3]$", "^:[0-7]$", "^([0-9]|[1-5][0-9]|6[0-3]):[0-7]$"};
|
||||
char *IPv4Address[] = {"^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$"};
|
||||
char *IPv6Address[] = {"^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$"};
|
||||
char *IPAddress[] = {"^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$", "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$"};
|
||||
char *MACAddress[] = {"^([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])$"};
|
||||
char *IPPrefix[] = {"^/(3[0-2]|[012]?[0-9])$", "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])/(3[0-2]|[012]?[0-9])$"};
|
||||
char *IPv4Prefix[] = {"^/(3[0-2]|[012]?[0-9])$", "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])/(3[0-2]|[012]?[0-9])$"};
|
||||
char *IPv6Prefix[] = {}; //TODO
|
||||
|
||||
void compress_spaces(char *str)
|
||||
{
|
||||
|
|
@ -1727,55 +1730,46 @@ bool match(const char *string, const char *pattern)
|
|||
return true;
|
||||
}
|
||||
|
||||
int dm_validate_string_length(char *value, char *min, char *max)
|
||||
static int dm_validate_string_length(char *value, int min_length, int max_length)
|
||||
{
|
||||
if (min != NULL && max != NULL) {
|
||||
if ((strlen(value) > atoi(max)) || (strlen(value) < atoi(min))) return -1;
|
||||
} else if (min != NULL && max == NULL) {
|
||||
if (strlen(value) < atoi(min)) return -1;
|
||||
} else if (min == NULL && max != NULL) {
|
||||
if (strlen(value) > atoi(max)) return -1;
|
||||
}
|
||||
if (((min_length > 0) && (strlen(value) < min_length)) || ((max_length > 0) && (strlen(value) > max_length)))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_validate_string_enumeration(char *value, char *enumeration[])
|
||||
static int dm_validate_string_enumeration(char *value, char *enumeration[], int enumeration_size)
|
||||
{
|
||||
for (; *enumeration; enumeration++) {
|
||||
if (strcmp(*enumeration, value) == 0)
|
||||
int i;
|
||||
for (i = 0; i < enumeration_size; i++) {
|
||||
if (strcmp(enumeration[i], value) == 0)
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int dm_validate_string_pattern(char *value, char *pattern[])
|
||||
static int dm_validate_string_pattern(char *value, char *pattern[], int pattern_size)
|
||||
{
|
||||
for (; *pattern; pattern++) {
|
||||
if (match(value, *pattern))
|
||||
int i;
|
||||
for (i = 0; i < pattern_size; i++) {
|
||||
if (match(value, pattern[i]))
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int dm_validate_string(char *value, char *min, char *max, char *enumeration[], char *pattern[])
|
||||
int dm_validate_string(char *value, int min_length, int max_length, char *enumeration[], int enumeration_size, char *pattern[], int pattern_size)
|
||||
{
|
||||
/* check size */
|
||||
if (min != NULL || max != NULL) {
|
||||
if (dm_validate_string_length(value, min, max))
|
||||
return -1;
|
||||
}
|
||||
if (dm_validate_string_length(value, min_length, max_length))
|
||||
return -1;
|
||||
|
||||
/* check enumeration */
|
||||
if (enumeration != NULL) {
|
||||
if (dm_validate_string_enumeration(value, enumeration))
|
||||
return -1;
|
||||
}
|
||||
if (enumeration && dm_validate_string_enumeration(value, enumeration, enumeration_size))
|
||||
return -1;
|
||||
|
||||
/* check pattern */
|
||||
if (pattern != NULL) {
|
||||
if (dm_validate_string_pattern(value, pattern))
|
||||
return -1;
|
||||
}
|
||||
if (pattern && dm_validate_string_pattern(value, pattern, pattern_size))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1784,121 +1778,115 @@ int dm_validate_boolean(char *value)
|
|||
{
|
||||
/* check format */
|
||||
if ((value[0] == '1' && value[1] == '\0') || (value[0] == '0' && value[1] == '\0')
|
||||
|| (strcasecmp(value, "true") == 0) || (strcasecmp(value, "false") == 0)) {
|
||||
|| (strcmp(value, "true") == 0) || (strcmp(value, "false") == 0)) {
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int dm_validate_unsignedInt(char *value, char *min, char *max)
|
||||
int dm_validate_unsignedInt(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
unsigned long val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
int i;
|
||||
|
||||
if (min) minval = strtoul(min, &endmin, 10);
|
||||
if (max) maxval = strtoul(max, &endmax, 10);
|
||||
/* check size for each range */
|
||||
for (i = 0; i < r_args_size; i++) {
|
||||
unsigned long val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
if (r_args[i].min) minval = strtoul(r_args[i].min, &endmin, 10);
|
||||
if (r_args[i].max) maxval = strtoul(r_args[i].max, &endmax, 10);
|
||||
|
||||
val = strtoul(value, &endval, 10);
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
|
||||
if ((*endval != 0) || (errno != 0)) return -1;
|
||||
val = strtoul(value, &endval, 10);
|
||||
|
||||
/* check size */
|
||||
if (min != NULL && max != NULL) {
|
||||
if ((val > maxval) || (val < minval)) return -1;
|
||||
} else if (min != NULL && max == NULL) {
|
||||
if (val < minval) return -1;
|
||||
} else if (min == NULL && max != NULL) {
|
||||
if (val > maxval) return -1;
|
||||
} else {
|
||||
if ((val > (unsigned int)UINT_MAX) || (val < 0)) return -1;
|
||||
if ((*endval != 0) || (errno != 0)) return -1;
|
||||
|
||||
/* check size */
|
||||
if ((r_args[i].min && val < minval) || (r_args[i].max && val > maxval) || (val < 0) || (val > (unsigned int)UINT_MAX))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_validate_int(char *value, char *min, char *max)
|
||||
int dm_validate_int(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
long val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
int i;
|
||||
|
||||
if (min) minval = strtol(min, &endmin, 10);
|
||||
if (max) maxval = strtol(max, &endmax, 10);
|
||||
/* check size for each range */
|
||||
for (i = 0; i < r_args_size; i++) {
|
||||
long val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
if (r_args[i].min) minval = strtol(r_args[i].min, &endmin, 10);
|
||||
if (r_args[i].max) maxval = strtol(r_args[i].max, &endmax, 10);
|
||||
|
||||
val = strtol(value, &endval, 10);
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
|
||||
if ((*endval != 0) || (errno != 0)) return -1;
|
||||
val = strtol(value, &endval, 10);
|
||||
|
||||
/* check size */
|
||||
if (min != NULL && max != NULL) {
|
||||
if ((val > maxval) || (val < minval)) return -1;
|
||||
} else if (min != NULL && max == NULL) {
|
||||
if (val < minval) return -1;
|
||||
} else if (min == NULL && max != NULL) {
|
||||
if (val > maxval) return -1;
|
||||
} else {
|
||||
if ((val > INT_MAX) || (val < INT_MIN)) return -1;
|
||||
if ((*endval != 0) || (errno != 0)) return -1;
|
||||
|
||||
/* check size */
|
||||
if ((r_args[i].min && val < minval) || (r_args[i].max && val > maxval) || (val < INT_MIN) || (val > INT_MAX))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_validate_unsignedLong(char *value, char *min, char *max)
|
||||
int dm_validate_unsignedLong(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
unsigned long val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
int i;
|
||||
|
||||
if (min) minval = strtoul(min, &endmin, 10);
|
||||
if (max) maxval = strtoul(max, &endmax, 10);
|
||||
/* check size for each range */
|
||||
for (i = 0; i < r_args_size; i++) {
|
||||
unsigned long val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
if (r_args[i].min) minval = strtoul(r_args[i].min, &endmin, 10);
|
||||
if (r_args[i].max) maxval = strtoul(r_args[i].max, &endmax, 10);
|
||||
|
||||
val = strtoul(value, &endval, 10);
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
|
||||
if ((*endval != 0) || (errno != 0)) return -1;
|
||||
val = strtoul(value, &endval, 10);
|
||||
|
||||
/* check size */
|
||||
if (min != NULL && max != NULL) {
|
||||
if ((val > maxval) || (val < minval)) return -1;
|
||||
} else if (min != NULL && max == NULL) {
|
||||
if (val < minval) return -1;
|
||||
} else if (min == NULL && max != NULL) {
|
||||
if (val > maxval) return -1;
|
||||
} else {
|
||||
if ((val > (unsigned long)ULONG_MAX) || (val < 0)) return -1;
|
||||
if ((*endval != 0) || (errno != 0)) return -1;
|
||||
|
||||
/* check size */
|
||||
if ((r_args[i].min && val < minval) || (r_args[i].max && val > maxval) || (val < 0) || (val > (unsigned long)ULONG_MAX))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_validate_long(char *value, char *min, char *max)
|
||||
int dm_validate_long(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
long val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
int i;
|
||||
|
||||
if (min) minval = strtol(min, &endmin, 10);
|
||||
if (max) maxval = strtol(max, &endmax, 10);
|
||||
/* check size for each range */
|
||||
for (i = 0; i < r_args_size; i++) {
|
||||
long val = 0, minval = 0, maxval = 0;
|
||||
char *endval = NULL, *endmin = NULL, *endmax = NULL;
|
||||
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
if (r_args[i].min) minval = strtol(r_args[i].min, &endmin, 10);
|
||||
if (r_args[i].max) maxval = strtol(r_args[i].max, &endmax, 10);
|
||||
|
||||
val = strtol(value, &endval, 10);
|
||||
/* reset errno to 0 before call */
|
||||
errno = 0;
|
||||
|
||||
if ((*endval != 0) || (errno != 0)) return -1;
|
||||
val = strtol(value, &endval, 10);
|
||||
|
||||
/* check size */
|
||||
if (min != NULL && max != NULL) {
|
||||
if ((val > maxval) || (val < minval)) return -1;
|
||||
} else if (min != NULL && max == NULL) {
|
||||
if (val < minval) return -1;
|
||||
} else if (min == NULL && max != NULL) {
|
||||
if (val > maxval) return -1;
|
||||
if ((*endval != 0) || (errno != 0)) return -1;
|
||||
|
||||
/* check size */
|
||||
if ((r_args[i].min && val < minval) || (r_args[i].max && val > maxval))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -1908,63 +1896,51 @@ int dm_validate_dateTime(char *value)
|
|||
{
|
||||
/* check format */
|
||||
struct tm tm;
|
||||
if (!(strptime(value, "%Y-%m-%dT%H:%M:%S", &tm)))
|
||||
if (!(strptime(value, "%Y-%m-%dT%H:%M:%SZ", &tm)))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_validate_hexBinary(char *value, char *min, char *max)
|
||||
int dm_validate_hexBinary(char *value, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
/* check format */
|
||||
int i;
|
||||
|
||||
/* check format */
|
||||
for (i = 0; i < strlen(value); i++) {
|
||||
if (!isxdigit(value[i]))
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* check size */
|
||||
if (min != NULL && max != NULL) {
|
||||
if (strcmp(min, max) == 0) {
|
||||
if (strlen(value) != (2 * atoi(max))) return -1;
|
||||
} else {
|
||||
if ((strlen(value) > atoi(max)) || (strlen(value) < atoi(min))) return -1;
|
||||
for (i = 0; i < r_args_size; i++) {
|
||||
if ((r_args[i].min && r_args[i].max && (atoi(r_args[i].min) == atoi(r_args[i].max)) && (strlen(value) != 2 * atoi(r_args[i].max))) ||
|
||||
(r_args[i].min && !r_args[i].max && (strlen(value) < atoi(r_args[i].min))) ||
|
||||
(!r_args[i].min && r_args[i].max && (strlen(value) > atoi(r_args[i].max)))) {
|
||||
return -1;
|
||||
}
|
||||
} else if (min != NULL && max == NULL) {
|
||||
if (strlen(value) < atoi(min)) return -1;
|
||||
} else if (min == NULL && max != NULL) {
|
||||
if (strlen(value) > atoi(max)) return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_validate_size_list(char *min_item, char *max_item, int nbr_item)
|
||||
static int dm_validate_size_list(int min_item, int max_item, int nbr_item)
|
||||
{
|
||||
if (min_item != NULL && max_item != NULL) {
|
||||
if (strcmp(min_item, max_item) == 0) {
|
||||
if (nbr_item != (2 * atoi(max_item))) return -1;
|
||||
} else {
|
||||
if ((nbr_item > atoi(max_item)) || (nbr_item < atoi(min_item))) return -1;
|
||||
}
|
||||
} else if (min_item != NULL && max_item == NULL) {
|
||||
if (nbr_item < atoi(min_item)) return -1;
|
||||
} else if (min_item == NULL && max_item != NULL) {
|
||||
if (nbr_item > atoi(max_item)) return -1;
|
||||
if (((min_item > 0) && (max_item > 0) && (min_item == max_item) && (nbr_item != 2 * max_item)) ||
|
||||
((min_item > 0) && (nbr_item < min_item)) ||
|
||||
((max_item > 0) && (nbr_item > max_item))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_validate_string_list(char *value, char *min_item, char *max_item, char *max_size, char *min, char *max, char *enumeration[], char *pattern[])
|
||||
int dm_validate_string_list(char *value, int min_item, int max_item, int max_size, int min, int max, char *enumeration[], int enumeration_size, char *pattern[], int pattern_size)
|
||||
{
|
||||
char *pch, *pchr;
|
||||
int nbr_item = 0;
|
||||
|
||||
/* check length of list */
|
||||
if (max_size != NULL) {
|
||||
if (strlen(value) > atoi(max_size))
|
||||
if ((max_size > 0) && (strlen(value) > max_size))
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* copy data in buffer */
|
||||
char buf[strlen(value)+1];
|
||||
|
|
@ -1973,30 +1949,26 @@ int dm_validate_string_list(char *value, char *min_item, char *max_item, char *m
|
|||
|
||||
/* for each value, validate string */
|
||||
for (pch = strtok_r(buf, ",", &pchr); pch != NULL; pch = strtok_r(NULL, ",", &pchr)) {
|
||||
if (dm_validate_string(pch, min, max, enumeration, pattern))
|
||||
if (dm_validate_string(pch, min, max, enumeration, enumeration_size, pattern, pattern_size))
|
||||
return -1;
|
||||
nbr_item ++;
|
||||
}
|
||||
|
||||
/* check size of list */
|
||||
if (min_item != NULL || max_item != NULL) {
|
||||
if (dm_validate_size_list(min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
}
|
||||
if (dm_validate_size_list(min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_validate_unsignedInt_list(char *value, char *min_item, char *max_item, char *max_size, char *min, char *max)
|
||||
int dm_validate_unsignedInt_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size)
|
||||
{
|
||||
char *pch, *pchr;
|
||||
int nbr_item = 0;
|
||||
|
||||
/* check length of list */
|
||||
if (max_size != NULL) {
|
||||
if (strlen(value) > atoi(max_size))
|
||||
if ((max_size > 0) && (strlen(value) > max_size))
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* copy data in buffer */
|
||||
char buf[strlen(value)+1];
|
||||
|
|
@ -2005,48 +1977,14 @@ int dm_validate_unsignedInt_list(char *value, char *min_item, char *max_item, ch
|
|||
|
||||
/* for each value, validate string */
|
||||
for (pch = strtok_r(buf, ",", &pchr); pch != NULL; pch = strtok_r(NULL, ",", &pchr)) {
|
||||
if (dm_validate_unsignedInt(pch, min, max))
|
||||
if (dm_validate_unsignedInt(pch, r_args, r_args_size))
|
||||
return -1;
|
||||
nbr_item ++;
|
||||
}
|
||||
|
||||
/* check size of list */
|
||||
if (min_item != NULL || max_item != NULL) {
|
||||
if (dm_validate_size_list(min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dm_validate_int_list(char *value, char *min_item, char *max_item, char *max_size, char *min, char *max)
|
||||
{
|
||||
char *pch, *pchr;
|
||||
int nbr_item = 0;
|
||||
|
||||
/* check length of list */
|
||||
if (max_size != NULL) {
|
||||
if (strlen(value) > atoi(max_size))
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* copy data in buffer */
|
||||
char buf[strlen(value)+1];
|
||||
strncpy(buf, value, sizeof(buf));
|
||||
buf[strlen(value)] = '\0';
|
||||
|
||||
/* for each value, validate string */
|
||||
for (pch = strtok_r(buf, ",", &pchr); pch != NULL; pch = strtok_r(NULL, ",", &pchr)) {
|
||||
if (dm_validate_int(pch, min, max))
|
||||
return -1;
|
||||
nbr_item ++;
|
||||
}
|
||||
|
||||
/* check size of list */
|
||||
if (min_item != NULL || max_item != NULL) {
|
||||
if (dm_validate_size_list(min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
}
|
||||
if (dm_validate_size_list(min_item, max_item, nbr_item))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2055,19 +1993,19 @@ int get_base64char_value(char b64)
|
|||
{
|
||||
char *base64C = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
int i;
|
||||
for (i = 0; i<64; i++)
|
||||
if ( base64C[i] == b64 )
|
||||
for (i = 0; i < 64; i++)
|
||||
if (base64C[i] == b64)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
char *decode64 (char *enc)
|
||||
char *decode64(char *enc)
|
||||
{
|
||||
int i, j=0;
|
||||
int i, j = 0;
|
||||
size_t decsize = strlen(enc)*6/8;
|
||||
char *dec = (char *)dmmalloc((decsize +1) * sizeof(char));
|
||||
|
||||
for (i=0; i<strlen(enc)-1; i++) {
|
||||
for (i = 0; i < strlen(enc)-1; i++) {
|
||||
dec[j] = (get_base64char_value(enc[i]) << (j%3==0?2:(j%3==1?4:6))) + (get_base64char_value(enc[i+1]) >> (j%3==0?4:(j%3==1? 2:0)));
|
||||
if (j%3 == 2)
|
||||
i++;
|
||||
|
|
@ -2081,7 +2019,7 @@ int is_string_exist_in_str_array(char **cert_paths, int length, char *dirpath, c
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<length; i++) {
|
||||
for (i = 0; i < length; i++) {
|
||||
if (strncmp(cert_paths[i], dirpath, strlen(dirpath)) == 0 && strstr(cert_paths[i], filename))
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -2117,19 +2055,18 @@ char *get_cert_directory_path_from_uci(char *ucipath)
|
|||
return pth;
|
||||
}
|
||||
|
||||
char **get_all_iop_certificates(int* length)
|
||||
char **get_all_iop_certificates(int *length)
|
||||
{
|
||||
char * certs_uci[] = {"openvpn.sample_server.cert", "openvpn.sample_client.cert", "owsd.ubusproxy.peer_cert", "owsd.wan_https.cert"};
|
||||
int i, j=0;
|
||||
char *dirpath = NULL;
|
||||
int number_certs_dirs = sizeof(certs_uci)/sizeof(certs_uci[0]);
|
||||
char *certs_uci[] = {"openvpn.sample_server.cert", "openvpn.sample_client.cert", "owsd.ubusproxy.peer_cert", "owsd.wan_https.cert"};
|
||||
int i, j = 0;
|
||||
char *dirpath = NULL, **certificates_paths = NULL;
|
||||
int number_certs_dirs = ARRAY_SIZE(certs_uci);
|
||||
|
||||
char **certificates_paths = NULL;
|
||||
certificates_paths = (char**)dmmalloc(1024 * sizeof(char*));
|
||||
certificates_paths = (char **)dmmalloc(1024 * sizeof(char *));
|
||||
|
||||
for (i=0; i<number_certs_dirs; i++) {
|
||||
for (i = 0; i < number_certs_dirs; i++) {
|
||||
dirpath = get_cert_directory_path_from_uci(certs_uci[i]);
|
||||
if (dirpath && strlen(dirpath)>0) {
|
||||
if (dirpath && strlen(dirpath) > 0) {
|
||||
DIR *dir;
|
||||
struct dirent *ent;
|
||||
if ((dir = opendir(dirpath)) == NULL)
|
||||
|
|
@ -2140,6 +2077,7 @@ char **get_all_iop_certificates(int* length)
|
|||
dmasprintf(&certificates_paths[j],"%s%s", dirpath, ent->d_name);
|
||||
j++;
|
||||
}
|
||||
closedir(dir);
|
||||
dmfree(dirpath);
|
||||
dirpath = NULL;
|
||||
}
|
||||
|
|
@ -2148,26 +2086,26 @@ char **get_all_iop_certificates(int* length)
|
|||
return certificates_paths;
|
||||
}
|
||||
|
||||
char* stringToHex(char *text, int length)
|
||||
char *stringToHex(char *text, int length)
|
||||
{
|
||||
char *hex = NULL;
|
||||
int i, j;
|
||||
hex = (char *)dmcalloc(100, sizeof(char));
|
||||
|
||||
for (i = 0, j = 0; i < length; ++i, j += 3){
|
||||
for (i = 0, j = 0; i < length; ++i, j += 3) {
|
||||
sprintf(hex + j, "%02x", text[i] & 0xff);
|
||||
if (i<length-1)
|
||||
sprintf(hex + j+2, "%c", ':');
|
||||
if (i < length-1)
|
||||
sprintf(hex + j + 2, "%c", ':');
|
||||
}
|
||||
return hex;
|
||||
}
|
||||
|
||||
char* replace_char(char* str, char find, char replace)
|
||||
char *replace_char(char *str, char find, char replace)
|
||||
{
|
||||
char *current_pos = strchr(str,find);
|
||||
while (current_pos){
|
||||
char *current_pos = strchr(str, find);
|
||||
while (current_pos) {
|
||||
*current_pos = replace;
|
||||
current_pos = strchr(current_pos,find);
|
||||
current_pos = strchr(current_pos, find);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,9 @@ extern char *IPv4Address[];
|
|||
extern char *IPv6Address[];
|
||||
extern char *IPAddress[];
|
||||
extern char *MACAddress[];
|
||||
extern char *IPPrefix[];
|
||||
extern char *IPv4Prefix[];
|
||||
extern char *IPv6Prefix[];
|
||||
|
||||
#define NVRAM_FILE "/proc/nvram/WpaKey"
|
||||
#define MAX_DHCP_LEASES 256
|
||||
|
|
@ -102,6 +105,7 @@ extern char *MACAddress[];
|
|||
#define DHCP_LEASES_FILE "/tmp/dhcp.leases"
|
||||
#define DMMAP "dmmap"
|
||||
#define DHCPSTATICADDRESS_DISABLED_CHADDR "00:00:00:00:00:01"
|
||||
#define RANGE_ARGS (struct range_args[])
|
||||
|
||||
#define DM_ASSERT(X, Y) \
|
||||
do { \
|
||||
|
|
@ -175,6 +179,11 @@ enum strstructered_enum {
|
|||
STRUCTERED_NULL
|
||||
};
|
||||
|
||||
struct range_args {
|
||||
const char *min;
|
||||
const char *max;
|
||||
};
|
||||
|
||||
struct proc_routing {
|
||||
char *iface;
|
||||
char *flags;
|
||||
|
|
@ -303,19 +312,18 @@ int get_net_device_sysfs(const char *uci_iface, const char *name, char **value);
|
|||
char *get_device_from_wifi_iface(const char *wifi_iface, const char *wifi_section);
|
||||
int dm_time_format(time_t ts, char **dst);
|
||||
bool match(const char *string, const char *pattern);
|
||||
int dm_validate_string(char *value, char *min, char *max, char *enumeration[], char *pattern[]);
|
||||
int dm_validate_string(char *value, int min_length, int max_length, char *enumeration[], int enumeration_size, char *pattern[], int pattern_size);
|
||||
int dm_validate_boolean(char *value);
|
||||
int dm_validate_unsignedInt(char *value, char *min, char *max);
|
||||
int dm_validate_int(char *value, char *min, char *max);
|
||||
int dm_validate_unsignedLong(char *value, char *min, char *max);
|
||||
int dm_validate_long(char *value, char *min, char *max);
|
||||
int dm_validate_unsignedInt(char *value, struct range_args r_args[], int r_args_size);
|
||||
int dm_validate_int(char *value, struct range_args r_args[], int r_args_size);
|
||||
int dm_validate_unsignedLong(char *value, struct range_args r_args[], int r_args_size);
|
||||
int dm_validate_long(char *value, struct range_args r_args[], int r_args_size);
|
||||
int dm_validate_dateTime(char *value);
|
||||
int dm_validate_hexBinary(char *value, char *min, char *max);
|
||||
int dm_validate_string_list(char *value, char *min_item, char *max_item, char *max_size, char *min, char *max, char *enumeration[], char *pattern[]);
|
||||
int dm_validate_unsignedInt_list(char *value, char *min_item, char *max_item, char *max_size, char *min, char *max);
|
||||
int dm_validate_int_list(char *value, char *min_item, char *max_item, char *max_size, char *min, char *max);
|
||||
char **get_all_iop_certificates(int* length);
|
||||
int dm_validate_hexBinary(char *value, struct range_args r_args[], int r_args_size);
|
||||
int dm_validate_string_list(char *value, int min_item, int max_item, int max_size, int min, int max, char *enumeration[], int enumeration_size, char *pattern[], int pattern_size);
|
||||
int dm_validate_unsignedInt_list(char *value, int min_item, int max_item, int max_size, struct range_args r_args[], int r_args_size);
|
||||
char **get_all_iop_certificates(int *length);
|
||||
char *decode64 (char *enc);
|
||||
char* stringToHex(char *text, int length);
|
||||
char* replace_char(char* str, char find, char replace);
|
||||
char *stringToHex(char *text, int length);
|
||||
char *replace_char(char *str, char find, char replace);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -93,16 +93,17 @@ def getparamtype( dmparam ):
|
|||
return ptype
|
||||
|
||||
def getMinMaxEnumerationUnitPatternparam(paramtype, c):
|
||||
paramvalmin = None
|
||||
paramvalmax = None
|
||||
paramvalrange = None
|
||||
paramenum = None
|
||||
paramunit = None
|
||||
parampattern = None
|
||||
if paramtype == "string" or paramtype == "hexBinary" or paramtype == "base64":
|
||||
for cc in c:
|
||||
if cc.tag == "size":
|
||||
paramvalmin = cc.get("minLength")
|
||||
paramvalmax = cc.get("maxLength")
|
||||
if paramvalrange == None:
|
||||
paramvalrange = "%s,%s" % (cc.get("minLength"), cc.get("maxLength"))
|
||||
else:
|
||||
paramvalrange = "%s;%s,%s" % (paramvalrange, cc.get("minLength"), cc.get("maxLength"))
|
||||
if cc.tag == "enumeration":
|
||||
if paramenum == None:
|
||||
paramenum = "\"%s\"" % cc.get('value')
|
||||
|
|
@ -117,32 +118,35 @@ def getMinMaxEnumerationUnitPatternparam(paramtype, c):
|
|||
elif paramtype == "unsignedInt" or paramtype == "int" or paramtype == "unsignedLong" or paramtype == "long":
|
||||
for cc in c:
|
||||
if cc.tag == "range":
|
||||
paramvalmin = cc.get("minInclusive")
|
||||
paramvalmax = cc.get("maxInclusive")
|
||||
if paramvalrange == None:
|
||||
paramvalrange = "%s,%s" % (cc.get("minInclusive"), cc.get("maxInclusive"))
|
||||
else:
|
||||
paramvalrange = "%s;%s,%s" % (paramvalrange, cc.get("minInclusive"), cc.get("maxInclusive"))
|
||||
if cc.tag == "units":
|
||||
paramunit = cc.get("value")
|
||||
|
||||
return paramvalmin, paramvalmax, paramenum, paramunit, parampattern
|
||||
return paramvalrange, paramenum, paramunit, parampattern
|
||||
|
||||
|
||||
def getparamdatatyperef( datatyperef ):
|
||||
paramvalmin = None
|
||||
paramvalmax = None
|
||||
paramvalrange = None
|
||||
paramenum = None
|
||||
paramunit = None
|
||||
parampattern = None
|
||||
for d in xmlroot1:
|
||||
if d.tag == "dataType" and d.get("name") == datatyperef:
|
||||
if d.get("base") != "" and d.get("base") != None and d.get("name") == "Alias":
|
||||
paramvalmin, paramvalmax, paramenum, paramunit, parampattern = getparamdatatyperef(d.get("base"))
|
||||
paramvalrange, paramenum, paramunit, parampattern = getparamdatatyperef(d.get("base"))
|
||||
else:
|
||||
for dd in d:
|
||||
if dd.tag in listTypes:
|
||||
paramvalmin, paramvalmax, paramenum, paramunit, parampattern = getMinMaxEnumerationUnitPatternparam(dd.tag, dd)
|
||||
paramvalrange, paramenum, paramunit, parampattern = getMinMaxEnumerationUnitPatternparam(dd.tag, dd)
|
||||
break
|
||||
if dd.tag == "size":
|
||||
paramvalmin = dd.get("minLength")
|
||||
paramvalmax = dd.get("maxLength")
|
||||
if paramvalrange == None:
|
||||
paramvalrange = "%s,%s" % (dd.get("minLength"), dd.get("maxLength"))
|
||||
else:
|
||||
paramvalrange = "%s;%s,%s" % (paramvalrange, dd.get("minLength"), dd.get("maxLength"))
|
||||
if dd.tag == "enumeration":
|
||||
if paramenum == None:
|
||||
paramenum = "\"%s\"" % dd.get('value')
|
||||
|
|
@ -155,7 +159,7 @@ def getparamdatatyperef( datatyperef ):
|
|||
parampattern = "%s,\"%s\"" % (parampattern, dd.get('value'))
|
||||
break
|
||||
|
||||
return paramvalmin, paramvalmax, paramenum, paramunit, parampattern
|
||||
return paramvalrange, paramenum, paramunit, parampattern
|
||||
|
||||
def getparamlist( dmparam ):
|
||||
minItem = None
|
||||
|
|
@ -171,8 +175,7 @@ def getparamlist( dmparam ):
|
|||
|
||||
def getparamoption( dmparam ):
|
||||
datatype = None
|
||||
paramvalmin = None
|
||||
paramvalmax = None
|
||||
paramvalrange = None
|
||||
paramenum = None
|
||||
paramunit = None
|
||||
parampattern = None
|
||||
|
|
@ -189,25 +192,25 @@ def getparamoption( dmparam ):
|
|||
for c in s:
|
||||
datatype = c.tag if c.tag in listdataTypes else None
|
||||
if datatype != None:
|
||||
paramvalmin, paramvalmax, paramenum, paramunit, parampattern = getMinMaxEnumerationUnitPatternparam(datatype, c)
|
||||
paramvalrange, paramenum, paramunit, parampattern = getMinMaxEnumerationUnitPatternparam(datatype, c)
|
||||
break
|
||||
if c.tag == "dataType":
|
||||
datatype = c.get("ref")
|
||||
paramvalmin, paramvalmax, paramenum, paramunit, parampattern = getparamdatatyperef(c.get("ref"))
|
||||
paramvalrange, paramenum, paramunit, parampattern = getparamdatatyperef(c.get("ref"))
|
||||
break
|
||||
|
||||
if islist == 0:
|
||||
datatype = c.tag if c.tag in listdataTypes else None
|
||||
if datatype != None:
|
||||
paramvalmin, paramvalmax, paramenum, paramunit, parampattern = getMinMaxEnumerationUnitPatternparam(datatype, c)
|
||||
paramvalrange, paramenum, paramunit, parampattern = getMinMaxEnumerationUnitPatternparam(datatype, c)
|
||||
break
|
||||
if c.tag == "dataType":
|
||||
datatype = c.get("ref")
|
||||
paramvalmin, paramvalmax, paramenum, paramunit, parampattern = getparamdatatyperef(datatype)
|
||||
paramvalrange, paramenum, paramunit, parampattern = getparamdatatyperef(datatype)
|
||||
break
|
||||
break
|
||||
|
||||
return islist, datatype, paramvalmin, paramvalmax, paramenum, paramunit, parampattern, listminItem, listmaxItem, listmaxsize
|
||||
return islist, datatype, paramvalrange, paramenum, paramunit, parampattern, listminItem, listmaxItem, listmaxsize
|
||||
|
||||
listmapping = []
|
||||
def generatelistfromfile(dmobject):
|
||||
|
|
@ -437,7 +440,7 @@ def printOBJ( dmobject, hasobj, hasparam, bbfdm_type ):
|
|||
|
||||
def printPARAM( dmparam, dmobject, bbfdm_type ):
|
||||
hasmapping, mapping = getparammapping(dmobject, dmparam)
|
||||
islist, datatype, paramvalmin, paramvalmax, paramenum, paramunit, parampattern, listminItem, listmaxItem, listmaxsize = getparamoption(dmparam)
|
||||
islist, datatype, paramvalrange, paramenum, paramunit, parampattern, listminItem, listmaxItem, listmaxsize = getparamoption(dmparam)
|
||||
|
||||
fp = open('./.json_tmp', 'a')
|
||||
print >> fp, "\"%s\" : {" % dmparam.get('name')
|
||||
|
|
@ -451,42 +454,48 @@ def printPARAM( dmparam, dmobject, bbfdm_type ):
|
|||
print >> fp, "\"list\" : {"
|
||||
|
||||
# add datatype
|
||||
print >> fp, ("\"datatype\" : \"%s\"," % datatype) if (listmaxsize != None or listminItem != None or listmaxItem != None or paramvalmin != None or paramvalmax != None or paramunit != None or paramenum != None or parampattern != None or (hasmapping and islist == 0)) else ("\"datatype\" : \"%s\"" % datatype)
|
||||
print >> fp, ("\"datatype\" : \"%s\"," % datatype) if (listmaxsize != None or listminItem != None or listmaxItem != None or paramvalrange != None or paramunit != None or paramenum != None or parampattern != None or (hasmapping and islist == 0)) else ("\"datatype\" : \"%s\"" % datatype)
|
||||
|
||||
if islist == 1:
|
||||
# add maximum size of list
|
||||
if listmaxsize != None:
|
||||
print >> fp, ("\"maxsize\" : %s," % listmaxsize) if (listminItem != None or listmaxItem != None or paramvalmin != None or paramvalmax != None or paramunit != None or paramenum != None or parampattern != None) else ("\"maxsize\" : %s" % listmaxsize)
|
||||
print >> fp, ("\"maxsize\" : %s," % listmaxsize) if (listminItem != None or listmaxItem != None or paramvalrange != None or paramunit != None or paramenum != None or parampattern != None) else ("\"maxsize\" : %s" % listmaxsize)
|
||||
|
||||
# add minimun and maximum item values
|
||||
if listminItem != None and listmaxItem != None:
|
||||
print >> fp, "\"item\" : {"
|
||||
print >> fp, "\"min\" : %s," % listminItem
|
||||
print >> fp, "\"max\" : %s" % listmaxItem
|
||||
print >> fp, ("},") if (paramvalmin != None or paramvalmax != None or paramunit != None or paramenum != None or parampattern != None) else ("}")
|
||||
print >> fp, ("},") if (paramvalrange != None or paramunit != None or paramenum != None or parampattern != None) else ("}")
|
||||
elif listminItem != None and listmaxItem == None:
|
||||
print >> fp, "\"item\" : {"
|
||||
print >> fp, "\"min\" : %s" % listminItem
|
||||
print >> fp, ("},") if (paramvalmin != None or paramvalmax != None or paramunit != None or paramenum != None or parampattern != None) else ("}")
|
||||
print >> fp, ("},") if (paramvalrange != None or paramunit != None or paramenum != None or parampattern != None) else ("}")
|
||||
elif listminItem == None and listmaxItem != None:
|
||||
print >> fp, "\"item\" : {"
|
||||
print >> fp, "\"max\" : %s" % listmaxItem
|
||||
print >> fp, ("},") if (paramvalmin != None or paramvalmax != None or paramunit != None or paramenum != None or parampattern != None) else ("}")
|
||||
print >> fp, ("},") if (paramvalrange != None or paramunit != None or paramenum != None or parampattern != None) else ("}")
|
||||
|
||||
# add minimun and maximum values
|
||||
if paramvalmin != None and paramvalmax != None:
|
||||
print >> fp, "\"range\" : {"
|
||||
print >> fp, "\"min\" : %s," % paramvalmin
|
||||
print >> fp, "\"max\" : %s" % paramvalmax
|
||||
print >> fp, ("},") if (paramunit != None or paramenum != None or parampattern != None or (hasmapping and islist == 0)) else ("}")
|
||||
elif paramvalmin != None and paramvalmax == None:
|
||||
print >> fp, "\"range\" : {"
|
||||
print >> fp, "\"min\" : %s" % paramvalmin
|
||||
print >> fp, ("},") if (paramunit != None or paramenum != None or parampattern != None or (hasmapping and islist == 0)) else ("}")
|
||||
elif paramvalmin == None and paramvalmax != None:
|
||||
print >> fp, "\"range\" : {"
|
||||
print >> fp, "\"max\" : %s" % paramvalmax
|
||||
print >> fp, ("},") if (paramunit != None or paramenum != None or parampattern != None or (hasmapping and islist == 0)) else ("}")
|
||||
if paramvalrange != None:
|
||||
valranges = paramvalrange.split(";")
|
||||
print >> fp, "\"range\" : ["
|
||||
for eachvalrange in valranges:
|
||||
valrange = eachvalrange.split(",")
|
||||
if valrange[0] != "None" and valrange[1] != "None":
|
||||
print >> fp, "{"
|
||||
print >> fp, "\"min\" : %s," % valrange[0]
|
||||
print >> fp, "\"max\" : %s" % valrange[1]
|
||||
print >> fp, ("},") if (eachvalrange == valranges[len(valranges)-1]) else ("}")
|
||||
elif valrange[0] != "None" and valrange[1] == "None":
|
||||
print >> fp, "{"
|
||||
print >> fp, "\"min\" : %s" % valrange[0]
|
||||
print >> fp, ("},") if (eachvalrange == valranges[len(valranges)-1]) else ("}")
|
||||
elif valrange[0] == "None" and valrange[1] != "None":
|
||||
print >> fp, "{"
|
||||
print >> fp, "\"max\" : %s" % valrange[1]
|
||||
print >> fp, ("},") if (eachvalrange == valranges[len(valranges)-1]) else ("}")
|
||||
print >> fp, ("],") if (paramunit != None or paramenum != None or parampattern != None or (hasmapping and islist == 0)) else ("]")
|
||||
|
||||
# add unit
|
||||
if paramunit != None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue