MCPcopy Create free account
hub / github.com/NetSys/bess / Init

Method Init

core/modules/l2_forward.cc:557–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

555};
556
557CommandResponse L2Forward::Init(const bess::pb::L2ForwardArg &arg) {
558 int ret = 0;
559 int size = arg.size();
560 int bucket = arg.bucket();
561
562 default_gate_ = DROP_GATE;
563
564 if (size == 0) {
565 size = DEFAULT_TABLE_SIZE;
566 }
567 if (bucket == 0) {
568 bucket = MAX_BUCKET_SIZE;
569 }
570
571 ret = l2_init(&l2_table_, size, bucket);
572
573 if (ret != 0) {
574 return CommandFailure(-ret,
575 "initialization failed with argument "
576 "size: '%d' bucket: '%d'",
577 size, bucket);
578 }
579
580 return CommandSuccess();
581}
582
583void L2Forward::DeInit() {
584 l2_deinit(&l2_table_);

Callers

nothing calls this directly

Calls 4

l2_initFunction · 0.85
CommandFailureFunction · 0.85
CommandSuccessFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected