From e4aedb233289133c900e24d1deed866ca513a155 Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Wed, 2 May 2007 20:28:50 +0200 Subject: [PATCH] more configdata --- cfgpatch.c | 2 +- configdata.c | 11 ++++++++++- configdata.h | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cfgpatch.c b/cfgpatch.c index ac4d50a..334786f 100644 --- a/cfgpatch.c +++ b/cfgpatch.c @@ -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"); diff --git a/configdata.c b/configdata.c index 95a2134..297eefc 100644 --- a/configdata.c +++ b/configdata.c @@ -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; @@ -240,6 +244,11 @@ static struct cfg_patch patcharr[] = {{ .patch = patch_16bit, .offset = 0x53e8, .min = 0, .max = 65536, +}, { + .code = CFG_CPUVLANID, + .patch = patch_8bit, + .offset = 0x5d69, + .min = 1, .max = 255, }, { .code = CFG_PORTENABLE_MASK, .mask = 0xFFFFFFE0, diff --git a/configdata.h b/configdata.h index 583faa6..009b5b9 100644 --- a/configdata.h +++ b/configdata.h @@ -14,7 +14,7 @@ enum { CFG_MACAGEING, - CFG_CPUVLAN, + CFG_CPUVLANID, CFG_SNMP_READ_COMMUNITY, CFG_SNMP_WRITE_COMMUNITY,