OpenSDN source code
bgp_config_parser.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #ifndef SRC_BGP_BGP_CONFIG_PARSER_H_
7 #define SRC_BGP_BGP_CONFIG_PARSER_H_
8 
9 #include <list>
10 #include <string>
11 
12 #include "base/util.h"
13 
14 class DB;
15 struct DBRequest;
16 namespace pugi {
17 class xml_node;
18 }
19 
20 // Convert an xml file into a set of IFMapTable requests.
22 public:
23  typedef std::list<DBRequest *> RequestList;
24 
25  explicit BgpConfigParser(DB *db);
26 
27  bool Parse(const std::string &content);
28 
29  static std::string session_uuid(const std::string &left,
30  const std::string &right,
31  int index);
32 
33 private:
34  bool ParseConfig(const pugi::xml_node &root, bool add_change,
35  RequestList *requests) const;
36  bool ParseRoutingInstance(const pugi::xml_node &parent, bool add_change,
37  RequestList *requests) const;
38  bool ParseVirtualNetwork(const pugi::xml_node &parent, bool add_change,
39  RequestList *requests) const;
40  bool ParseSubCluster(const pugi::xml_node &parent, bool add_change,
41  RequestList *requests) const;
42  bool ParseRoutingPolicy(const pugi::xml_node &parent, bool add_change,
43  RequestList *requests) const;
44  bool ParseRouteAggregate(const pugi::xml_node &parent, bool add_change,
45  RequestList *requests) const;
46  bool ParseGlobalSystemConfig(const pugi::xml_node &parent, bool add_change,
47  RequestList *requests) const;
48  bool ParseGlobalQosConfig(const pugi::xml_node &parent, bool add_change,
49  RequestList *requests) const;
50 
51  DB *db_;
53 };
54 
55 #endif // SRC_BGP_BGP_CONFIG_PARSER_H_
std::list< DBRequest * > RequestList
bool ParseConfig(const pugi::xml_node &root, bool add_change, RequestList *requests) const
bool ParseGlobalQosConfig(const pugi::xml_node &parent, bool add_change, RequestList *requests) const
bool Parse(const std::string &content)
DISALLOW_COPY_AND_ASSIGN(BgpConfigParser)
bool ParseRoutingInstance(const pugi::xml_node &parent, bool add_change, RequestList *requests) const
bool ParseRoutingPolicy(const pugi::xml_node &parent, bool add_change, RequestList *requests) const
bool ParseGlobalSystemConfig(const pugi::xml_node &parent, bool add_change, RequestList *requests) const
bool ParseSubCluster(const pugi::xml_node &parent, bool add_change, RequestList *requests) const
bool ParseRouteAggregate(const pugi::xml_node &parent, bool add_change, RequestList *requests) const
static std::string session_uuid(const std::string &left, const std::string &right, int index)
bool ParseVirtualNetwork(const pugi::xml_node &parent, bool add_change, RequestList *requests) const
Definition: db.h:25