@@ -87,13 +87,13 @@ def _protocol(self, neighbor):
87
87
self [Capability .CODE .MULTIPROTOCOL ] = mp
88
88
89
89
def _asn4 (self , neighbor ):
90
- if not neighbor . asn4 :
90
+ if not neighbor [ 'capability' ][ ' asn4' ] :
91
91
return
92
92
93
- self [Capability .CODE .FOUR_BYTES_ASN ] = ASN4 (neighbor . local_as )
93
+ self [Capability .CODE .FOUR_BYTES_ASN ] = ASN4 (neighbor [ 'local-as' ] )
94
94
95
95
def _nexthop (self , neighbor ):
96
- if not neighbor . nexthop :
96
+ if not neighbor [ 'capability' ][ ' nexthop' ] :
97
97
return
98
98
99
99
nexthops = neighbor .nexthops ()
@@ -105,48 +105,48 @@ def _nexthop(self, neighbor):
105
105
self [Capability .CODE .NEXTHOP ] = NextHop (nh_pairs )
106
106
107
107
def _addpath (self , neighbor ):
108
- if not neighbor . add_path :
108
+ if not neighbor [ 'capability' ][ 'add-path' ] :
109
109
return
110
110
111
111
families = neighbor .addpaths ()
112
112
ap_families = []
113
113
for allowed in self ._ADD_PATH :
114
114
if allowed in families :
115
115
ap_families .append (allowed )
116
- self [Capability .CODE .ADD_PATH ] = AddPath (ap_families , neighbor . add_path )
116
+ self [Capability .CODE .ADD_PATH ] = AddPath (ap_families , neighbor [ 'capability' ][ 'add-path' ] )
117
117
118
118
def _graceful (self , neighbor , restarted ):
119
- if not neighbor . graceful_restart :
119
+ if not neighbor [ 'capability' ][ 'graceful-restart' ] :
120
120
return
121
121
122
122
self [Capability .CODE .GRACEFUL_RESTART ] = Graceful ().set (
123
123
Graceful .RESTART_STATE if restarted else 0x0 ,
124
- neighbor . graceful_restart ,
124
+ neighbor [ 'capability' ][ 'graceful-restart' ] ,
125
125
[(afi , safi , Graceful .FORWARDING_STATE ) for (afi , safi ) in neighbor .families ()],
126
126
)
127
127
128
128
def _refresh (self , neighbor ):
129
- if not neighbor . route_refresh :
129
+ if not neighbor [ 'capability' ][ 'route-refresh' ] :
130
130
return
131
131
self [Capability .CODE .ROUTE_REFRESH ] = RouteRefresh ()
132
132
self [Capability .CODE .ENHANCED_ROUTE_REFRESH ] = EnhancedRouteRefresh ()
133
133
134
134
def _extended_message (self , neighbor ):
135
- if not neighbor . extended_message :
135
+ if not neighbor [ 'capability' ][ 'extended-message' ] :
136
136
return
137
137
138
138
self [Capability .CODE .EXTENDED_MESSAGE ] = ExtendedMessage ()
139
139
140
140
def _hostname (self , neighbor ):
141
- self [Capability .CODE .HOSTNAME ] = HostName (neighbor . host_name , neighbor . domain_name )
141
+ self [Capability .CODE .HOSTNAME ] = HostName (neighbor [ 'host-name' ] , neighbor [ 'domain-name' ] )
142
142
143
143
def _operational (self , neighbor ):
144
- if not neighbor . operational :
144
+ if not neighbor [ 'capability' ][ ' operational' ] :
145
145
return
146
146
self [Capability .CODE .OPERATIONAL ] = Operational ()
147
147
148
148
def _session (self , neighbor ):
149
- if not neighbor . multisession :
149
+ if not neighbor [ 'capability' ][ 'multi-session' ] :
150
150
return
151
151
# XXX: FIXME: should it not be the RFC version ?
152
152
self [Capability .CODE .MULTISESSION ] = MultiSession ().set ([Capability .CODE .MULTIPROTOCOL ])
0 commit comments