yang完整树管理
2021-04-02 15:26:06 0 举报
AI智能生成
树状结构的看见性操作
作者其他创作
大纲/内容
Acls┗YContainer
yangmodels::YList<Acl> acl_;
Acl
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YLeaf<Owner> nkacl_owner_;
using Owner = std::string;
yangmodels::YLeaf<AclType> type_;
using AclType = std::string;
yangmodels::YLeaf<TableName> nkacl_table_;
using TableName = std::string;
yangmodels::YLeaf<ChainName> nkacl_chain_;
using ChainName = std::string;
yangmodels::YList<Aces> aces_;
Aces
┗YListNode
┗YListNode
yangmodels::YList<Ace> ace_;
Ace
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YLeaf<Priority> nkacl_priority_;
using Priority = int16_t;
yangmodels::YList<Matches> matches_;
Matches
┗YListNode
┗YListNode
yangmodels::YList<Ipv4> ipv4_;
Ipv4
┗YListNode
┗YListNode
yangmodels::YLeaf<Protocol> protocol_;
using Protocol = uint8_t;
yangmodels::YLeaf<InetIpv4Prefix> source_ipv4_network_;
using InetIpv4Prefix = std::string;
yangmodels::YLeaf<InetIpv4Prefix> destination_ipv4_network_;
using InetIpv4Prefix = std::string;
yangmodels::YList<Ipv6> ipv6_;
Ipv6
┗YListNode
┗YListNode
yangmodels::YLeaf<Protocol> protocol_;
using Protocol = uint8_t;
yangmodels::YLeaf<InetIpv6Prefix> source_ipv6_network_;
using InetIpv6Prefix = std::string;
yangmodels::YLeaf<InetIpv6Prefix> destination_ipv6_network_;
using InetIpv6Prefix = std::string;
yangmodels::YList<Tcp> tcp_;
Tcp
┗L4ProtocolWithPort
┗L4ProtocolWithPort
yangmodels::YList<SourcePort> source_port_;
SourcePort
┗RangeOrMultipleRanges
┗RangeOrMultipleRanges
yangmodels::YLeaf<Port> lower_port_;
using Port = uint16_t;
yangmodels::YLeaf<Port> upper_port_;
yangmodels::YList<MultipleRanges> nkacl_multiple_ranges_;
MultipleRanges
┗YListNode
┗YListNode
yangmodels::YList<PortRange> port_range_;
PortRange
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YLeaf<Port> lower_port_;
yangmodels::YLeaf<Port> upper_port_;
yangmodels::YList<DestinationPort> destination_port_;
yangmodels::YList<Udp> udp_;
Udp
┗L4ProtocolWithPort
┗L4ProtocolWithPort
yangmodels::YList<Sctp> nkacl_sctp_;
Sctp
┗L4ProtocolWithPort
┗L4ProtocolWithPort
yangmodels::YList<MultipleIcmpTypes> nkacl_multiple_icmp_types_;
MultipleIcmpTypes
┗YListNode
┗YListNode
yangmodels::YLeafList<IcmpType> type_;
using IcmpType = uint8_t;
yangmodels::YLeaf<bool> match_reversed_;
yangmodels::YLeaf<Interface> egress_interface_;
using Interface = std::string;
yangmodels::YLeaf<Interface> ingress_interface_;
yangmodels::YLeaf<State> nkacl_state_;
using State = std::string;
yangmodels::YList<Actions> actions_;
Actions
┗ YListNode
┗ YListNode
yangmodels::YLeaf<Forwarding> forwarding_;
using Forwarding = std::string;
yangmodels::YList<PayloadStatement> nkacl_payload_statement_;
PayloadStatement
┗YListNode
┗YListNode
yangmodels::YLeaf<Dscp> dscp_;
using Dscp = uint8_t;
yangmodels::YList<RateLimit> nkacl_ratelimit_;
RateLimit
┗YListNode
┗YListNode
yangmodels::YLeaf<uint32_t> rate_;
yangmodels::YLeaf<uint32_t> burst_;
yangmodels::YLeaf<std::string> unit_;
yangmodels::YLeaf<std::string> mode_;
yangmodels::YList<JumpGoto> nkacl_jump_goto_;
JumpGoto
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> nkacl_next_chain_;
yangmodels::YList<ArpAcl> nkacl_arp_acl_;
ArpAcl
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YLeaf<Owner> nkacl_owner_;
using Owner = std::string;
yangmodels::YLeaf<TableName> nkacl_table_;
yangmodels::YLeaf<ChainName> nkacl_chain_;
yangmodels::YList<ArpAces> aces_;
ArpAces
┗YListNode
┗YListNode
yangmodels::YList<ArpAce> ace_;
ArpAce
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YList<ArpMatches> matches_;
ArpMatches
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> operation_;
yangmodels::YLeaf<std::string> source_network_;
yangmodels::YLeaf<std::string> destination_network_;
yangmodels::YList<ArpActions> actions_;
ArpActions
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> forwarding_;
yangmodels::YList<ArpRateLimit> ratelimit_;
ArpRateLimit
┗YListNode
┗YListNode
yangmodels::YLeaf<uint32_t> rate_;
yangmodels::YLeaf<uint32_t> burst_;
yangmodels::YLeaf<std::string> unit_;
yangmodels::YList<ArpJumpGoto> jump_goto_;
ArpJumpGoto
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> next_chain_;
yangmodels::YList<AttachmentPoints> attachment_points_;
AttachmentPoints
┗YListNode
┗YListNode
yangmodels::YList<Table> nkacl_table_;
Table
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YLeaf<Owner> owner_;
yangmodels::YLeaf<TableFamily> family_;
using TableFamily = std::string;
yangmodels::YList<Chains> chains_;
Chains
┗YListNode
┗YListNode
yangmodels::YList<Chain> chain_;
Chain
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YLeaf<ChainHook> hook_;
using ChainHook = std::string;
yangmodels::YLeaf<Priority> priority_;
using Priority = int16_t;
yangmodels::YLeaf<ChainPolicy> policy_;|
using ChainPolicy = std::string;
yangmodels::YLeaf<int16_t> level_;
yangmodels::YList<AclSets> acl_sets_;
AclSets
┗YListNode
┗YListNode
yangmodels::YList<AclSet> acl_set_;
AclSet
┗YListNode yangmodels::YList<AceStatistics> ace_statistics_;
┗YListNode
yangmodels::YLeaf<std::string> name_;
AceStatistics
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YLeaf<uint64_t> matched_packets_;
yangmodels::YLeaf<uint64_t> matched_octets_;
yangmodels::YList<ArpTable> nkacl_arp_table_;
ArpTable
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YLeaf<Owner> owner_;
yangmodels::YList<ArpChains> chains_;
ArpChains
┗YListNode
┗YListNode
yangmodels::YList<ArpChain> chain_;
ArpChain
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YLeaf<std::string> hook_;
yangmodels::YLeaf<Priority> priority_;
using Priority = int16_t;
yangmodels::YLeaf<ChainPolicy> policy_;
using ChainPolicy = std::string;
yangmodels::YLeaf<int16_t> level_;
yangmodels::YList<ArpAclSets> acl_sets_;
ArpAclSets
┗YListNode
┗YListNode
yangmodels::YList<ArpAclSet> acl_set_;
ArpAclSet
┗YListNode yangmodels::YList<AceStatistics> ace_statistics_;
┗YListNode
yangmodels::YLeaf<std::string> name_;
AceStatistics
┗YListNode
┗YListNode
yangmodels::YLeaf<std::string> name_;
yangmodels::YLeaf<uint64_t> matched_packets_;
yangmodels::YLeaf<uint64_t> matched_octets_;
代码要求
支持自适应解析所有xml配置文件
支持自适应的解析重构或拷贝整树的所有节点
遍历所有节点
确认节点是否存在
完成值的重建或者拷贝
针对某个flowtype的实现
根据用户场景构建key,通过key完成配置文件与场景的映射
构造完整的xml字符串
数据源
TPL注入的可变参数
owner list
IP
port
httpclient获取的ext接口信息
xml配置文件中的固定配置信息
需要解决的问题
XML配置文件的拆分粒度
太大,不够灵活
太小,拼接逻辑比较复杂
0 条评论
下一页