2 * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.netvirt.aclservice.utils;
11 import java.math.BigInteger;
12 import org.opendaylight.ovsdb.utils.config.ConfigProperties;
15 * The class to have ACL related constants.
17 public final class AclConstants {
19 public static final short INGRESS_ACL_DEFAULT_FLOW_PRIORITY = 1;
20 public static final short EGRESS_ACL_DEFAULT_FLOW_PRIORITY = 11;
22 public static final Integer PROTO_IPV6_DROP_PRIORITY = 63020;
23 public static final Integer PROTO_IPV6_ALLOWED_PRIORITY = 63010;
24 public static final Integer PROTO_DHCP_SERVER_MATCH_PRIORITY = 63010;
25 public static final Integer PROTO_DHCP_CLIENT_TRAFFIC_MATCH_PRIORITY = 63010;
26 public static final Integer PROTO_MATCH_PRIORITY = 61010;
27 public static final Integer PREFIX_MATCH_PRIORITY = 61009;
28 public static final Integer PROTO_PREFIX_MATCH_PRIORITY = 61008;
29 public static final Integer PROTO_PORT_MATCH_PRIORITY = 61007;
30 public static final Integer PROTO_PORT_PREFIX_MATCH_PRIORITY = 61007;
31 public static final Integer PROTO_MATCH_SYN_ALLOW_PRIORITY = 61005;
32 public static final Integer PROTO_MATCH_SYN_ACK_ALLOW_PRIORITY = 61004;
33 public static final Integer PROTO_MATCH_SYN_DROP_PRIORITY = 61003;
34 public static final Integer PROTO_VM_IP_MAC_MATCH_PRIORITY = 36001;
35 public static final Integer CT_STATE_UNTRACKED_PRIORITY = 62030;
36 public static final Integer CT_STATE_TRACKED_EXIST_PRIORITY = 62020;
37 public static final Integer CT_STATE_TRACKED_NEW_PRIORITY = 62010;
38 public static final Integer CT_STATE_NEW_PRIORITY_DROP = 36007;
39 public static final short DHCP_CLIENT_PORT_IPV4 = 68;
40 public static final short DHCP_SERVER_PORT_IPV4 = 67;
41 public static final short DHCP_CLIENT_PORT_IPV6 = 546;
42 public static final short DHCP_SERVER_PORT_IPV6 = 547;
43 public static final BigInteger COOKIE_ACL_BASE = new BigInteger("6900000", 16);
45 public static final int UNTRACKED_CT_STATE = 0x00;
46 public static final int TRACKED_CT_STATE = 0x20;
47 public static final int TRACKED_EST_CT_STATE = 0x22;
48 public static final int TRACKED_REL_CT_STATE = 0x24;
49 public static final int TRACKED_NEW_CT_STATE = 0x21;
50 public static final int TRACKED_INV_CT_STATE = 0x30;
52 public static final int UNTRACKED_CT_STATE_MASK = 0x20;
53 public static final int TRACKED_CT_STATE_MASK = 0x20;
54 public static final int TRACKED_EST_CT_STATE_MASK = 0x37;
55 public static final int TRACKED_REL_CT_STATE_MASK = 0x37;
56 public static final int TRACKED_NEW_CT_STATE_MASK = 0x21;
57 public static final int TRACKED_INV_CT_STATE_MASK = 0x30;
59 public static final String IPV4_ALL_NETWORK = "0.0.0.0/0";
60 public static final long TCP_FLAG_SYN = 1 << 1;
61 public static final long TCP_FLAG_ACK = 1 << 4;
62 public static final long TCP_FLAG_SYN_ACK = TCP_FLAG_SYN + TCP_FLAG_ACK;
64 public static final int ICMPV6_TYPE_MLD_QUERY = 130;
65 public static final int ICMPV6_TYPE_RS = 133;
66 public static final int ICMPV6_TYPE_RA = 134;
67 public static final int ICMPV6_TYPE_NS = 135;
68 public static final int ICMPV6_TYPE_NA = 136;
69 public static final int ICMPV6_TYPE_MLD2_REPORT = 143;
71 private AclConstants() {
74 public static boolean isStatelessAcl() {
75 final String enabledPropertyStr = ConfigProperties.getProperty(AclConstants.class, "stateless.sg.enabled");
76 return enabledPropertyStr != null && enabledPropertyStr.equalsIgnoreCase("yes");