aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/VppSecurityGroupManager.hpp
blob: a9ce2c8ddadd40d0c6381dca7ac2b6278ba21397 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* -*- C++ -*-; c-basic-offset: 4; indent-tabs-mode: nil */
/*
 * Copyright (c) 2018 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */

#ifndef __VPP_SECURITY_GROUP_MANAGER_H__
#define __VPP_SECURITY_GROUP_MANAGER_H__

#include <opflexagent/Agent.h>
#include <opflexagent/EndpointManager.h>

#include <vom/acl_ethertype.hpp>
#include <vom/acl_l3_list.hpp>

using namespace VOM;

namespace VPP
{
class SecurityGroupManager
{
  public:
    SecurityGroupManager(opflexagent::Agent &agent);

    static void
    build_update(opflexagent::Agent &agent,
                 const opflexagent::EndpointListener::uri_set_t &secGrps,
                 const std::string &secGrpId,
                 ACL::l3_list::rules_t &in_rules,
                 ACL::l3_list::rules_t &out_rules,
                 ACL::acl_ethertype::ethertype_rules_t &ethertype_rules);

    static std::string
    get_id(const opflexagent::EndpointListener::uri_set_t &secGrps);

    void
    handle_set_update(const opflexagent::EndpointListener::uri_set_t &secGrps);
    void handle_update(const opflex::modb::URI &uri);

  private:
    /**
     * Referene to the uber-agent
     */
    opflexagent::Agent &m_agent;
};
}; // namespace VPP

/*
 * Local Variables:
 * eval: (c-set-style "llvm.org")
 * End:
 */

#endif