| 555 | }; |
| 556 | |
| 557 | CommandResponse 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 | |
| 583 | void L2Forward::DeInit() { |
| 584 | l2_deinit(&l2_table_); |
nothing calls this directly
no test coverage detected