Jian Li | 4324438 | 2021-01-09 00:19:02 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021-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 | package org.onosproject.kubevirtnetworking.api; |
| 17 | |
| 18 | import org.onlab.packet.MacAddress; |
| 19 | |
| 20 | /** |
| 21 | * Provides constants used in KubevirtNetworking. |
| 22 | */ |
| 23 | public final class Constants { |
| 24 | |
| 25 | private Constants() { |
| 26 | } |
| 27 | |
| 28 | public static final String KUBEVIRT_NETWORKING_APP_ID = |
| 29 | "org.onosproject.kubevirtnetworking"; |
| 30 | public static final String DEFAULT_GATEWAY_MAC_STR = "fe:00:00:00:00:02"; |
Daniel Park | 5ff76b7 | 2022-09-26 22:58:53 +0900 | [diff] [blame] | 31 | public static final String KUBERNETES_EXTERNAL_LB_FAKE_MAC_STR = "de:00:00:00:00:01"; |
| 32 | public static final MacAddress KUBERNETES_EXTERNAL_LB_FAKE_MAC = |
| 33 | MacAddress.valueOf(KUBERNETES_EXTERNAL_LB_FAKE_MAC_STR); |
Jian Li | 4324438 | 2021-01-09 00:19:02 +0900 | [diff] [blame] | 34 | public static final MacAddress DEFAULT_GATEWAY_MAC = |
| 35 | MacAddress.valueOf(DEFAULT_GATEWAY_MAC_STR); |
| 36 | |
Jian Li | 858ccd7 | 2021-02-04 17:25:01 +0900 | [diff] [blame] | 37 | public static final String TENANT_TO_TUNNEL_PREFIX = "i-to-t-"; |
| 38 | public static final String TUNNEL_TO_TENANT_PREFIX = "t-to-i-"; |
| 39 | |
Jian Li | 8f944d4 | 2021-03-23 00:43:29 +0900 | [diff] [blame] | 40 | // provider and VLAN integration bridge flow table index |
Jian Li | 4324438 | 2021-01-09 00:19:02 +0900 | [diff] [blame] | 41 | public static final int STAT_INBOUND_TABLE = 0; |
| 42 | public static final int VTAP_INBOUND_TABLE = 1; |
Jian Li | 4324438 | 2021-01-09 00:19:02 +0900 | [diff] [blame] | 43 | public static final int DHCP_TABLE = 5; |
Jian Li | f89d960 | 2021-04-27 19:05:49 +0900 | [diff] [blame] | 44 | public static final int GW_ENTRY_TABLE = 31; |
| 45 | public static final int GW_DROP_TABLE = 32; |
Jian Li | 4324438 | 2021-01-09 00:19:02 +0900 | [diff] [blame] | 46 | public static final int ARP_TABLE = 35; |
| 47 | public static final int ACL_EGRESS_TABLE = 40; |
Jian Li | 4324438 | 2021-01-09 00:19:02 +0900 | [diff] [blame] | 48 | public static final int ACL_RECIRC_TABLE = 43; |
Jian Li | 8f944d4 | 2021-03-23 00:43:29 +0900 | [diff] [blame] | 49 | public static final int ACL_INGRESS_TABLE = 44; |
| 50 | public static final int ACL_CT_TABLE = 45; |
Jian Li | 4324438 | 2021-01-09 00:19:02 +0900 | [diff] [blame] | 51 | public static final int STAT_OUTBOUND_TABLE = 70; |
| 52 | public static final int VTAP_OUTBOUND_TABLE = 71; |
| 53 | public static final int FORWARDING_TABLE = 80; |
| 54 | public static final int ERROR_TABLE = 100; |
| 55 | |
Jian Li | 8f944d4 | 2021-03-23 00:43:29 +0900 | [diff] [blame] | 56 | // tenant (VXLAN/GRE/GENEVE) integration bridge flow table index |
Jian Li | 556709c | 2021-02-03 17:54:28 +0900 | [diff] [blame] | 57 | public static final int TENANT_INBOUND_TABLE = 0; |
| 58 | public static final int TENANT_DHCP_TABLE = 5; |
Jian Li | 858ccd7 | 2021-02-04 17:25:01 +0900 | [diff] [blame] | 59 | public static final int TENANT_ARP_TABLE = 30; |
| 60 | public static final int TENANT_ICMP_TABLE = 35; |
Jian Li | 8f944d4 | 2021-03-23 00:43:29 +0900 | [diff] [blame] | 61 | public static final int TENANT_ACL_EGRESS_TABLE = 40; |
| 62 | public static final int TENANT_ACL_RECIRC_TABLE = 43; |
| 63 | public static final int TENANT_ACL_INGRESS_TABLE = 44; |
| 64 | public static final int TENANT_ACL_CT_TABLE = 45; |
Jian Li | 556709c | 2021-02-03 17:54:28 +0900 | [diff] [blame] | 65 | public static final int TENANT_FORWARDING_TABLE = 80; |
| 66 | |
Jian Li | 858ccd7 | 2021-02-04 17:25:01 +0900 | [diff] [blame] | 67 | // tunnel bridge flow table index |
| 68 | public static final int TUNNEL_DEFAULT_TABLE = 0; |
| 69 | |
Jian Li | 4324438 | 2021-01-09 00:19:02 +0900 | [diff] [blame] | 70 | // flow rule priority |
Jian Li | 858ccd7 | 2021-02-04 17:25:01 +0900 | [diff] [blame] | 71 | public static final int PRIORITY_ICMP_RULE = 43000; |
| 72 | public static final int PRIORITY_FORWARDING_RULE = 30000; |
Daniel Park | 328fb60 | 2021-05-31 13:49:53 +0900 | [diff] [blame] | 73 | public static final int PRIORITY_FLOATING_GATEWAY_TUN_BRIDGE_RULE = 32000; |
Daniel Park | 05a9458 | 2021-05-12 10:57:02 +0900 | [diff] [blame] | 74 | public static final int PRIORITY_LB_GATEWAY_TUN_BRIDGE_RULE = 33000; |
Jian Li | ca20b71 | 2021-01-18 00:19:31 +0900 | [diff] [blame] | 75 | public static final int PRIORITY_DHCP_RULE = 42000; |
Jian Li | 858ccd7 | 2021-02-04 17:25:01 +0900 | [diff] [blame] | 76 | public static final int PRIORITY_ARP_GATEWAY_RULE = 41000; |
Jian Li | 8f944d4 | 2021-03-23 00:43:29 +0900 | [diff] [blame] | 77 | public static final int PRIORITY_ARP_DEFAULT_RULE = 40000; |
Jian Li | 858ccd7 | 2021-02-04 17:25:01 +0900 | [diff] [blame] | 78 | public static final int PRIORITY_TUNNEL_RULE = 31000; |
Jian Li | f97a07e | 2021-01-13 18:05:00 +0900 | [diff] [blame] | 79 | |
Jian Li | 8f944d4 | 2021-03-23 00:43:29 +0900 | [diff] [blame] | 80 | public static final int PRIORITY_IP_INGRESS_RULE = 19000; |
| 81 | public static final int PRIORITY_IP_EGRESS_RULE = 18000; |
| 82 | public static final int PRIORITY_ACL_RULE = 31000; |
| 83 | public static final int PRIORITY_ACL_INGRESS_RULE = 30000; |
| 84 | public static final int PRIORITY_CT_HOOK_RULE = 30500; |
| 85 | public static final int PRIORITY_CT_RULE = 32000; |
| 86 | public static final int PRIORITY_CT_DROP_RULE = 32500; |
| 87 | |
Jian Li | f97a07e | 2021-01-13 18:05:00 +0900 | [diff] [blame] | 88 | // CLI item length |
| 89 | public static final int CLI_ID_LENGTH = 30; |
| 90 | public static final int CLI_NAME_LENGTH = 30; |
Jian Li | cb58042 | 2022-02-03 15:08:31 +0900 | [diff] [blame] | 91 | public static final int CLI_LONG_NAME_LENGTH = 50; |
Daniel Park | 6a83ee6 | 2022-10-26 11:57:34 +0900 | [diff] [blame^] | 92 | public static final int CLI_LONG_SERVICE_PORT_LENGTH = 100; |
Jian Li | f97a07e | 2021-01-13 18:05:00 +0900 | [diff] [blame] | 93 | public static final int CLI_IP_ADDRESSES_LENGTH = 50; |
| 94 | public static final int CLI_IP_ADDRESS_LENGTH = 25; |
Jian Li | 3ba5c58 | 2021-01-14 11:30:36 +0900 | [diff] [blame] | 95 | public static final int CLI_IP_ADDRESS_AVAILABILITY = 15; |
Jian Li | f97a07e | 2021-01-13 18:05:00 +0900 | [diff] [blame] | 96 | public static final int CLI_MAC_ADDRESS_LENGTH = 25; |
| 97 | public static final int CLI_PORTS_LENGTH = 20; |
| 98 | public static final int CLI_NAMESPACE_LENGTH = 15; |
Jian Li | ac31f65 | 2021-01-17 02:18:30 +0900 | [diff] [blame] | 99 | public static final int CLI_STATUS_LENGTH = 15; |
Jian Li | f97a07e | 2021-01-13 18:05:00 +0900 | [diff] [blame] | 100 | public static final int CLI_PHASE_LENGTH = 15; |
| 101 | public static final int CLI_TYPE_LENGTH = 15; |
| 102 | public static final int CLI_TYPES_LENGTH = 30; |
| 103 | public static final int CLI_SEG_ID_LENGTH = 10; |
| 104 | public static final int CLI_LABELS_LENGTH = 30; |
| 105 | public static final int CLI_CONTAINERS_LENGTH = 30; |
Jian Li | 810f58c | 2021-02-27 01:10:50 +0900 | [diff] [blame] | 106 | public static final int CLI_FLAG_LENGTH = 10; |
Jian Li | 1c10cf2 | 2021-03-05 01:32:04 +0900 | [diff] [blame] | 107 | public static final int CLI_NUMBER_LENGTH = 10; |
Jian Li | f97a07e | 2021-01-13 18:05:00 +0900 | [diff] [blame] | 108 | public static final int CLI_MARGIN_LENGTH = 2; |
Daniel Park | a896880 | 2021-02-25 09:14:22 +0900 | [diff] [blame] | 109 | |
| 110 | public static final int PRIORITY_STATEFUL_SNAT_RULE = 40500; |
Daniel Park | c1ba1f4 | 2022-05-16 17:30:24 +0900 | [diff] [blame] | 111 | public static final int PRIORITY_FLOATING_IP_UPSTREAM_RULE = 40800; |
| 112 | public static final int PRIORITY_FLOATING_IP_DOWNSTREAM_RULE = 40700; |
Daniel Park | 5ff76b7 | 2022-09-26 22:58:53 +0900 | [diff] [blame] | 113 | public static final int PRIORITY_ELB_UPSTREAM_RULE = 39000; |
| 114 | public static final int PRIORITY_ELB_DOWNSTREAM_RULE = 39500; |
Daniel Park | c1ba1f4 | 2022-05-16 17:30:24 +0900 | [diff] [blame] | 115 | |
Daniel Park | babde9c | 2021-03-09 13:37:42 +0900 | [diff] [blame] | 116 | public static final int PRIORITY_INTERNAL_ROUTING_RULE = 41000; |
Daniel Park | 05a9458 | 2021-05-12 10:57:02 +0900 | [diff] [blame] | 117 | public static final int PRIORITY_LB_RULE = 41500; |
| 118 | public static final int PRIORITY_LB_FIP_RULE = 41500; |
Jian Li | 4324438 | 2021-01-09 00:19:02 +0900 | [diff] [blame] | 119 | } |