From b0faeb91d78403b0ec04cc5cf9d6e80eba6d76fe Mon Sep 17 00:00:00 2001 From: William Metcalf Date: Tue, 30 Mar 2010 19:19:03 -0500 Subject: [PATCH] small PF_RING update cmd line opts changed --- src/source-pfring.c | 13 ++++++------- src/suricata.c | 20 ++++++++++---------- suricata.yaml | 4 ++-- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/source-pfring.c b/src/source-pfring.c index 4a3efdaafe..0e9492deda 100644 --- a/src/source-pfring.c +++ b/src/source-pfring.c @@ -75,7 +75,6 @@ typedef struct PfringThreadVars_ uint8_t cluster_id; char *interface; - char *cluster_type; /* counters */ uint32_t pkts; uint64_t bytes; @@ -217,12 +216,12 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, void *initdata, void **data) { memset(ptv, 0, sizeof(PfringThreadVars)); ptv->tv = tv; - if (ConfGet("pfring.clusterid", &tmpclusterid) != 1){ - SCLogError(SC_ERR_PF_RING_GET_CLUSTERID_FAILED,"could not get pfring.clusterid"); + if (ConfGet("pfring.cluster-id", &tmpclusterid) != 1){ + SCLogError(SC_ERR_PF_RING_GET_CLUSTERID_FAILED,"could not get pfring.cluster-id"); return TM_ECODE_FAILED; }else{ ptv->cluster_id = (uint8_t)atoi(tmpclusterid); - SCLogInfo("Going to use clusterid %" PRId32 "", ptv->cluster_id); + SCLogInfo("Going to use cluster-id %" PRId32 "", ptv->cluster_id); } if (ConfGet("pfring.interface", &ptv->interface) != 1){ @@ -247,15 +246,15 @@ TmEcode ReceivePfringThreadInit(ThreadVars *tv, void *initdata, void **data) { } #ifdef HAVE_PFRING_CLUSTER_TYPE - if (ConfGet("pfring.ctype", &tmpctype) != 1) { - SCLogError(SC_ERR_GET_CLUSTER_TYPE_FAILED,"Could not get pfring.ctype"); + if (ConfGet("pfring.cluster-type", &tmpctype) != 1) { + SCLogError(SC_ERR_GET_CLUSTER_TYPE_FAILED,"Could not get pfring.cluster-type"); return TM_ECODE_FAILED; } else if (strncmp(tmpctype, "cluster_round_robin", 19) == 0 || strncmp(tmpctype, "cluster_flow", 12) == 0) { SCLogInfo("pfring cluster type %s",tmpctype); ptv->ctype = (cluster_type)tmpctype; rc = pfring_set_cluster(ptv->pd, ptv->cluster_id, ptv->ctype); } else { - SCLogError(SC_ERR_INVALID_CLUSTER_TYPE,"invalid hash type %s",tmpctype); + SCLogError(SC_ERR_INVALID_CLUSTER_TYPE,"invalid cluster-type %s",tmpctype); return TM_ECODE_FAILED; } #else diff --git a/src/suricata.c b/src/suricata.c index e2500a8467..55645d5bf5 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -374,8 +374,8 @@ void usage(const char *progname) printf("\t--init-errors-fatal : enable fatal failure on signature init error\n"); printf("\t--dump-config : show the running configuration\n"); printf("\t--pfring-int : run in pfring mode\n"); - printf("\t--pfring-clusterid : pfring cluster id \n"); - printf("\t--pfring-ctype : pfring cluster type for PF_RING 4.1.2 and later cluster_round_robin|cluster_flow"); + printf("\t--pfring-cluster-id : pfring cluster id \n"); + printf("\t--pfring-cluster-type : pfring cluster type for PF_RING 4.1.2 and later cluster_round_robin|cluster_flow"); printf("\n"); printf("\nTo run the engine with default configuration on " "interface eth0 with signature file \"signatures.rules\", run the " @@ -419,8 +419,8 @@ int main(int argc, char **argv) struct option long_opts[] = { {"dump-config", 0, &dump_config, 1}, {"pfring-int", required_argument, 0, 0}, - {"pfring-clusterid", required_argument, 0, 0}, - {"pfring-ctype", required_argument, 0, 0}, + {"pfring-cluster-id", required_argument, 0, 0}, + {"pfring-cluster-type", required_argument, 0, 0}, {"unittest-filter", required_argument, 0, 'U'}, {"list-unittests", 0, &list_unittests, 1}, {"init-errors-fatal", 0, 0, 0}, @@ -443,15 +443,15 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } } - else if(strcmp((long_opts[option_index]).name , "pfring-clusterid") == 0){ - if (ConfSet("pfring.clusterid", optarg, 0) != 1) { - fprintf(stderr, "ERROR: Failed to set pfring clusterid.\n"); + else if(strcmp((long_opts[option_index]).name , "pfring-cluster-id") == 0){ + if (ConfSet("pfring.cluster-id", optarg, 0) != 1) { + fprintf(stderr, "ERROR: Failed to set pfring cluster-id.\n"); exit(EXIT_FAILURE); } } - else if(strcmp((long_opts[option_index]).name , "pfring-ctype") == 0){ - if (ConfSet("pfring.ctype", optarg, 0) != 1) { - fprintf(stderr, "ERROR: Failed to set pfring cluster type.\n"); + else if(strcmp((long_opts[option_index]).name , "pfring-cluster-type") == 0){ + if (ConfSet("pfring.cluster-type", optarg, 0) != 1) { + fprintf(stderr, "ERROR: Failed to set pfring cluster-type.\n"); exit(EXIT_FAILURE); } } diff --git a/suricata.yaml b/suricata.yaml index 9188fa8082..2518e8719a 100644 --- a/suricata.yaml +++ b/suricata.yaml @@ -225,11 +225,11 @@ pfring: # Default clusterid. PF_RING will load balance packets based on flow. # All threads/processes that will participate need to have the same # clusterid. - clusterid: 99 + cluster-id: 99 # Default PF_RING cluster type. PF_RING can load balance per flow or per hash. # This is only supported in versions of PF_RING > 4.1.1. - ctype: cluster_round_robin + cluster-type: cluster_round_robin # For FreeBSD ipfw(8) divert(4) support. # Please make sure you have ipfw_load="YES" and ipdivert_load="YES"