Browse Source

more configdata

master
Olaf Rempel 12 years ago
parent
commit
e4aedb2332
3 changed files with 12 additions and 3 deletions
  1. 1
    1
      cfgpatch.c
  2. 10
    1
      configdata.c
  3. 1
    1
      configdata.h

+ 1
- 1
cfgpatch.c View File

@@ -35,7 +35,7 @@ int main(int argc, char *argv[])
config_patch(config->data, CFG_SNMP_READ_COMMUNITY, "public1234");
config_patch(config->data, CFG_SNMP_WRITE_COMMUNITY, "private1234");

config_patch(config->data, CFG_CPUVLAN, "124");
config_patch(config->data, CFG_CPUVLANID, "124");

config_patch(config->data, CFG_PORTVLAN_MASK + 1, "124:check:all");
config_patch(config->data, CFG_PORTVLAN_MASK + 2, "124:nocheck:tagged");

+ 10
- 1
configdata.c View File

@@ -94,7 +94,6 @@ static int patch_snmp_community(void *config, struct cfg_patch *patch, int code,
return 0;
}

/* TODO: not working "unknown ctl bits" */
static int patch_portvlan(void *config, struct cfg_patch *patch, int code, const char *parameter)
{
int port = code - patch->code;
@@ -120,6 +119,8 @@ static int patch_portvlan(void *config, struct cfg_patch *patch, int code, const
/* TODO: not working "unknown ctl bits" */
static int patch_dot1qvlan(void *config, struct cfg_patch *patch, int code, const char *parameter)
{
return -1;

int id = code - patch->code;
if (id < 1 || id > 32)
return -1;
@@ -141,8 +142,11 @@ static int patch_dot1qvlan(void *config, struct cfg_patch *patch, int code, cons
return 0;
}

/* TODO: not working "unknown ctl bits" */
static int patch_dot1qport(void *config, struct cfg_patch *patch, int code, const char *parameter)
{
return -1;

int id = code - patch->code;
if (id < 1 || id > 32)
return -1;
@@ -241,6 +245,11 @@ static struct cfg_patch patcharr[] = {{
.offset = 0x53e8,
.min = 0, .max = 65536,
}, {
.code = CFG_CPUVLANID,
.patch = patch_8bit,
.offset = 0x5d69,
.min = 1, .max = 255,
}, {
.code = CFG_PORTENABLE_MASK,
.mask = 0xFFFFFFE0,
.patch = patch_portenable,

+ 1
- 1
configdata.h View File

@@ -14,7 +14,7 @@ enum {

CFG_MACAGEING,

CFG_CPUVLAN,
CFG_CPUVLANID,

CFG_SNMP_READ_COMMUNITY,
CFG_SNMP_WRITE_COMMUNITY,

Loading…
Cancel
Save