small PF_RING update cmd line opts changed

remotes/origin/master-1.0.x
William Metcalf 16 years ago committed by Victor Julien
parent 4879045c6f
commit b0faeb91d7

@ -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

@ -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 <dev> : run in pfring mode\n");
printf("\t--pfring-clusterid <id> : pfring cluster id \n");
printf("\t--pfring-ctype <ctype> : pfring cluster type for PF_RING 4.1.2 and later cluster_round_robin|cluster_flow");
printf("\t--pfring-cluster-id <id> : pfring cluster id \n");
printf("\t--pfring-cluster-type <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);
}
}

@ -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"

Loading…
Cancel
Save