blob: e9a89db9ac63f73149da61017bf78f04607a7f21 [file] [log] [blame]
Georgios Katsikas70671b32018-07-02 18:47:27 +02001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.drivers.server.devices.nic;
18
19import com.google.common.base.Strings;
20
21import static com.google.common.base.Preconditions.checkArgument;
22
23
24/**
25* Definition of network interface card's (NIC) rule's scope.
26*/
27public enum NicRuleScope {
28 /**
29 * A NIC rules is applied to the ingress traffic.
30 */
31 INGRESS("ingress"),
32 /**
33 * A NIC rules is applied to the egress traffic.
34 */
35 EGRESS("egress");
36
37 protected String scope;
38
39 private NicRuleScope(String scope) {
40 checkArgument(!Strings.isNullOrEmpty(scope),
41 "NIC rule scope is NULL or empty");
42 this.scope = scope.toLowerCase();
43 }
44
45 @Override
46 public String toString() {
47 return scope;
48 }
49
50}