3bad4869c8933dbd0b54f2f78785a5e17958cb66
[netvirt.git] /
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.api.utils.AclInterface;
19 import org.opendaylight.netvirt.aclservice.utils.AclDataUtil;
20 import org.opendaylight.netvirt.aclservice.utils.AclServiceUtils;
21 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairs;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
25
26 /**
27  * Provides the transparent implementation for egress (w.r.t VM) ACL service.
28  *
29  */
30 public class TransparentEgressAclServiceImpl extends AbstractEgressAclServiceImpl {
31
32     private static final Logger LOG = LoggerFactory.getLogger(TransparentEgressAclServiceImpl.class);
33
34     public TransparentEgressAclServiceImpl(DataBroker dataBroker, IMdsalApiManager mdsalManager,
35             AclDataUtil aclDataUtil, AclServiceUtils aclServiceUtils) {
36         super(dataBroker, mdsalManager, aclDataUtil, aclServiceUtils);
37     }
38
39     @Override
40     public void bindService(AclInterface aclInterface) {
41         LOG.debug("transparent egress acl service - do nothing");
42     }
43
44     @Override
45     protected void unbindService(AclInterface aclInterface) {
46         LOG.debug("transparent egress acl service - do nothing");
47     }
48
49     @Override
50     protected void programGeneralFixedRules(BigInteger dpid, String dhcpMacAddress,
51             List<AllowedAddressPairs> allowedAddresses, int lportTag, Action action,
52             int addOrRemove) {
53         LOG.debug("transparent egress acl service - do nothing");
54     }
55
56     @Override
57     protected void programSpecificFixedRules(BigInteger dpid, String dhcpMacAddress,
58             List<AllowedAddressPairs> allowedAddresses, int lportTag, String portId, Action action, int addOrRemove) {
59     }
60
61     @Override
62     protected void programAceRule(AclInterface port, int addOrRemove, String aclName, Ace ace,
63             List<AllowedAddressPairs> syncAllowedAddresses) {
64         LOG.debug("transparent egress acl service - do nothing");
65     }
66
67     @Override
68     protected String syncSpecificAclFlow(BigInteger dpId, int lportTag, int addOrRemove, Ace ace, String portId,
69             Map<String, List<MatchInfoBase>> flowMap, String flowName) {
70         // Not in use here. programAceRule function is overridden.
71         return null;
72     }
73
74 }