Bug 7020: Deletion issue when VM has multiple SGs with same rules
[netvirt.git] / vpnservice / aclservice / impl / src / main / java / org / opendaylight / netvirt / aclservice / TransparentIngressAclServiceImpl.java
1 /*
2  * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.netvirt.aclservice;
9
10 import java.math.BigInteger;
11 import java.util.List;
12 import java.util.Map;
13
14 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
15 import org.opendaylight.genius.mdsalutil.MatchInfoBase;
16 import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
17 import org.opendaylight.netvirt.aclservice.api.AclServiceManager.Action;
18 import org.opendaylight.netvirt.aclservice.utils.AclDataUtil;
19 import org.opendaylight.netvirt.aclservice.utils.AclServiceUtils;
20 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairs;
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
24
25 /**
26  * Provides the transparent implementation for ingress (w.r.t VM) ACL service.
27  *
28  * <p>
29  * Note: Table names used are w.r.t switch. Hence, switch ingress is VM egress
30  * and vice versa.
31  */
32 public class TransparentIngressAclServiceImpl extends AbstractIngressAclServiceImpl {
33
34     private static final Logger LOG = LoggerFactory.getLogger(TransparentIngressAclServiceImpl.class);
35
36     public TransparentIngressAclServiceImpl(DataBroker dataBroker, IMdsalApiManager mdsalManager,
37             AclDataUtil aclDataUtil, AclServiceUtils aclServiceUtils) {
38         super(dataBroker, mdsalManager, aclDataUtil, aclServiceUtils);
39     }
40
41     @Override
42     protected void bindService(String interfaceName) {
43         LOG.debug("transparent ingress acl service - do nothing");
44     }
45
46     @Override
47     protected void unbindService(String interfaceName) {
48         LOG.debug("transparent ingress acl service - do nothing");
49     }
50
51     @Override
52     protected void programGeneralFixedRules(BigInteger dpid, String dhcpMacAddress,
53             List<AllowedAddressPairs> allowedAddresses, int lportTag, Action action,
54             int addOrRemove) {
55         LOG.debug("transparent ingress acl service - do nothing");
56     }
57
58     @Override
59     protected String syncSpecificAclFlow(BigInteger dpId, int lportTag, int addOrRemove, String aclName, Ace ace,
60             String portId, Map<String, List<MatchInfoBase>> flowMap, String flowName) {
61         // Not in use here. programAceRule function is overridden.
62         return null;
63     }
64
65     @Override
66     protected void programSpecificFixedRules(BigInteger dpid, String dhcpMacAddress,
67             List<AllowedAddressPairs> allowedAddresses, int lportTag, String portId, Action action, int addOrRemove) {
68     }
69
70     @Override
71     protected void programAceRule(BigInteger dpId, int lportTag, int addOrRemove, String aclName, Ace ace,
72             String portId, List<AllowedAddressPairs> syncAllowedAddresses) {
73         LOG.debug("Transparent ingress acl service - do nothing");
74     }
75 }