blob: 50170fa6c08b11e6e60b2e9235b09e229a4ba4ea [file] [log] [blame]
Jian Li7e8f57e2019-01-24 18:31:03 +09001/*
2 * Copyright 2016-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 */
16package org.onosproject.k8snetworking.api;
17
Jian Li66f6e3c2019-01-25 10:24:44 +090018import org.onlab.packet.MacAddress;
19
Jian Li7e8f57e2019-01-24 18:31:03 +090020/**
Jian Li66f6e3c2019-01-25 10:24:44 +090021 * Provides constants used in kubernetes network switching and routing.
Jian Li7e8f57e2019-01-24 18:31:03 +090022 */
23public final class Constants {
24
25 private Constants() {
26 }
27
28 public static final String K8S_NETWORKING_APP_ID = "org.onosproject.k8snetworking";
Jian Li66f6e3c2019-01-25 10:24:44 +090029
30 public static final String ARP_BROADCAST_MODE = "broadcast";
31 public static final String ARP_PROXY_MODE = "proxy";
32
Jian Li004526d2019-02-25 16:26:27 +090033 public static final String NAT_STATEFUL = "stateful";
34 public static final String NAT_STATELESS = "stateless";
35
Jian Li66f6e3c2019-01-25 10:24:44 +090036 public static final String DEFAULT_GATEWAY_MAC_STR = "fe:00:00:00:00:02";
Jian Lid89db462019-02-08 18:21:57 +090037
Jian Li66f6e3c2019-01-25 10:24:44 +090038 public static final MacAddress DEFAULT_GATEWAY_MAC =
39 MacAddress.valueOf(DEFAULT_GATEWAY_MAC_STR);
40
Jian Li004526d2019-02-25 16:26:27 +090041 public static final String SHIFTED_IP_CIDR = "172.10.0.0/16";
42 public static final String SHIFTED_IP_PREFIX = "172.10";
43
Jian Li5e8a22a2019-02-27 11:48:42 +090044 public static final String SRC = "src";
45 public static final String DST = "dst";
46
Jian Li004526d2019-02-25 16:26:27 +090047 // TODO: need to inject service IP CIDR through REST
48 public static final String SERVICE_IP_CIDR = "10.96.0.0/24";
49
Jian Libde20bf2019-01-25 17:34:43 +090050 public static final String PORT_NAME_PREFIX_CONTAINER = "veth";
51
Jian Li66f6e3c2019-01-25 10:24:44 +090052 public static final String ANNOTATION_NETWORK_ID = "networkId";
53 public static final String ANNOTATION_PORT_ID = "portId";
54 public static final String ANNOTATION_CREATE_TIME = "createTime";
55 public static final String ANNOTATION_SEGMENT_ID = "segId";
56
57 // flow priority
58 public static final int PRIORITY_SNAT_RULE = 26000;
Jian Li4aa17642019-01-30 00:01:11 +090059 public static final int PRIORITY_TUNNEL_TAG_RULE = 30000;
Jian Lid89db462019-02-08 18:21:57 +090060 public static final int PRIORITY_TRANSLATION_RULE = 30000;
Jian Li66f6e3c2019-01-25 10:24:44 +090061 public static final int PRIORITY_CT_HOOK_RULE = 30500;
62 public static final int PRIORITY_CT_RULE = 32000;
63 public static final int PRIORITY_CT_DROP_RULE = 32500;
Jian Li004526d2019-02-25 16:26:27 +090064 public static final int PRIORITY_NAT_RULE = 30000;
Jian Li4aa17642019-01-30 00:01:11 +090065 public static final int PRIORITY_SWITCHING_RULE = 30000;
Jian Li66f6e3c2019-01-25 10:24:44 +090066 public static final int PRIORITY_ARP_GATEWAY_RULE = 41000;
67 public static final int PRIORITY_ARP_SUBNET_RULE = 40000;
68 public static final int PRIORITY_ARP_CONTROL_RULE = 40000;
69 public static final int PRIORITY_ARP_REPLY_RULE = 40000;
70 public static final int PRIORITY_ARP_REQUEST_RULE = 40000;
71 public static final int PRIORITY_ARP_FLOOD_RULE = 39000;
72 public static final int PRIORITY_FORCED_ACL_RULE = 50000;
73 public static final int PRIORITY_ICMP_PROBE_RULE = 50000;
74
75 // flow table index
76 public static final int STAT_INBOUND_TABLE = 0;
77 public static final int VTAP_INBOUND_TABLE = 1;
78 public static final int VTAP_INBOUND_MIRROR_TABLE = 2;
Jian Li66f6e3c2019-01-25 10:24:44 +090079 public static final int VTAG_TABLE = 30;
80 public static final int ARP_TABLE = 35;
81 public static final int ACL_EGRESS_TABLE = 40;
82 public static final int ACL_INGRESS_TABLE = 44;
83 public static final int CT_TABLE = 45;
84 public static final int ACL_RECIRC_TABLE = 43;
85 public static final int JUMP_TABLE = 50;
Jian Li2cc2b632019-02-18 00:56:40 +090086 public static final int NAT_TABLE = 51;
Jian Li004526d2019-02-25 16:26:27 +090087 public static final int SERVICE_TABLE = 52;
88 public static final int POD_TABLE = 53;
Jian Li66f6e3c2019-01-25 10:24:44 +090089 public static final int ROUTING_TABLE = 60;
90 public static final int STAT_OUTBOUND_TABLE = 70;
91 public static final int VTAP_OUTBOUND_TABLE = 71;
92 public static final int VTAP_OUTBOUND_MIRROR_TABLE = 72;
93 public static final int FORWARDING_TABLE = 80;
94 public static final int ERROR_TABLE = 100;
Jian Li7e8f57e2019-01-24 18:31:03 +090095}