Skip to content

Commit

Permalink
parsing include
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-mangin committed Jan 12, 2021
1 parent 11d7cf9 commit 3de545c
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 263 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ classifiers = [

[tool.poetry.dependencies]
python = "~3.6 || ~3.7 || ^3.8" # Compatible python versions must be declared here
pygments-yang-lexer = "^0.2"
pyang = "^2.3.2"
pyangbind="^0.8.1"
pygments-yang-lexer = "^0.2"

# Optional dependencies (development)
pudb = "^2019.2"
Expand Down
36 changes: 31 additions & 5 deletions yang/exabgp.yang
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ module exabgp {
prefix ietf-inet-types;
}

import openconfig-bgp-types {
prefix openconfig-bgp-types;
}

organization
"Exa Networks";
contact
Expand All @@ -22,6 +18,35 @@ module exabgp {
"Initial revision.";
}

// From openconfig-bgp-types.yang

typedef bgp-std-community-type {
// TODO: further refine restrictions and allowed patterns
// 4-octet value:
// <as number> 2 octets
// <community value> 2 octets
type union {
type uint32 {
// per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 -
// 0xFFFFFFFF are reserved
}
type string {
pattern '^(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' +
'(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' +
'|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$';
}
}
description
"Type definition for standard commmunity attributes represented as
a integer value, or a string of the form N:M where N and M are
integers between 0 and 65535.";
reference
"RFC 1997 - BGP Communities Attribute";
}

// End openconfig-bgp-types.yang

typedef router-name {
description
"The IP address or DNS name of a router";
Expand All @@ -31,6 +56,7 @@ module exabgp {
}
}


grouping nlri-v4 {
leaf prefix {
type ietf-inet-types:ipv4-address;
Expand Down Expand Up @@ -122,7 +148,7 @@ module exabgp {
leaf-list community {
description
"";
type openconfig-bgp-types:bgp-std-community-type;
type bgp-std-community-type;
}
leaf-list large-commity {
description
Expand Down
Loading

0 comments on commit 3de545c

Please sign in to comment.