Пример #1
0
 def __init__(self, sequence, sticky=False, community=None):
     self.sequence = sequence
     self.sticky = sticky
     ExtendedCommunity.__init__(
         self, community if community else pack(
             '!2sBxI', self._subtype(
                 transitive=True), 1 if sticky else 0, sequence))
Пример #2
0
    def __init__(self, order, reserved=0, community=None):
        self.order = order
        self.reserved = reserved

        ExtendedCommunity.__init__(
            self, community if community is not None else pack("!2sIH", self._subtype(), order, reserved)
        )
Пример #3
0
 def __init__(self, sample, terminal, community=None):
     self.sample = sample
     self.terminal = terminal
     bitmask = self._sample[sample] | self._terminal[terminal]
     ExtendedCommunity.__init__(
         self, community if community is not None else pack("!BBLBB", 0x80, 0x07, 0, 0, bitmask)
     )
Пример #4
0
 def __init__(self, sample, terminal, community=None):
     self.sample = sample
     self.terminal = terminal
     bitmask = self._sample[sample] | self._terminal[terminal]
     ExtendedCommunity.__init__(
         self, community if community is not None else pack('!2sLBB', self._subtype(), 0, 0, bitmask)
     )
Пример #5
0
 def __init__(self, encaps, control, mtu, reserved, community=None):
     self.encaps = encaps
     self.control = control
     self.mtu = mtu
     self.reserved = reserved
     ExtendedCommunity.__init__(
         self, community if community is not None else pack(
             "!BBLH", 0x80, 0x0A, 0, self.tunnel_type))
Пример #6
0
	def __init__ (self, tunnel_type, community=None):
		self.tunnel_type = tunnel_type
		ExtendedCommunity.__init__(
			self,community if community is not None else pack(
				"!BBLH",
				0x03,0x0C,
				0,self.tunnel_type
			)
		)
Пример #7
0
 def __init__(self, trans, asn, target, direction, community=None):
     self.asn = asn
     self.target = target
     self.direction = direction
     self.transitive = trans
     new_target = (direction << 14) + target
     ExtendedCommunity.__init__(
         self, community if community is not None else pack(
             "!2sLH", self._subtype(self.transitive), asn, new_target))
Пример #8
0
	def __init__ (self, tunnel_type, community=None):
		self.tunnel_type = tunnel_type
		ExtendedCommunity.__init__(
			self,community if community is not None else pack(
				"!2sLH",
				self._packedTypeSubtype(),
				0,self.tunnel_type
			)
		)
Пример #9
0
 def __init__(self, encaps, control, mtu, reserved, community=None):
     self.encaps = encaps
     self.control = control
     self.mtu = mtu
     self.reserved = reserved
     # reserved is called preference in draft-ietf-l2vpn-vpls-multihoming-07
     ExtendedCommunity.__init__(
         self, community if community is not None else pack(
             "!2sBBHH", self._subtype(), encaps, control, mtu, reserved))
Пример #10
0
	def __init__ (self, asn, speed, community=None):
		self.asn = asn
		self.speed = speed
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!Hf",asn,speed
			)
		)
Пример #11
0
	def __init__ (self, copy, community=None):
		self.copy = copy
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!BBLH",
				0x80,0x00,
				0,1 if copy else 0
			)
		)
Пример #12
0
	def __init__ (self, copy, community=None):
		self.copy = copy
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2sLH",
				self._subtype(),
				0,1 if copy else 0
			)
		)
Пример #13
0
	def __init__ (self, dscp, community=None):
		self.dscp = dscp
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2sLBB",
				self._subtype(),
				0,0,dscp
			)
		)
Пример #14
0
	def __init__ (self, dscp, community=None):
		self.dscp = dscp
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!BBLBB",
				0x80,0x09,
				0,0,dscp
			)
		)
Пример #15
0
	def __init__ (self, copy, community=None):
		self.copy = copy
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2sLH",
				self._subtype(),
				0,1 if copy else 0
			)
		)
Пример #16
0
	def __init__ (self, dscp, community=None):
		self.dscp = dscp
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2sLBB",
				self._subtype(),
				0,0,dscp
			)
		)
Пример #17
0
	def __init__ (self, asn, rate, community=None):
		self.asn = asn
		self.rate = rate
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2sHf",
				self._subtype(),
				asn,rate
			)
		)
Пример #18
0
	def __init__ (self, asn, target, community=None):
		self.asn = asn
		self.target = target
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2sHL",
				self._subtype(),
				asn,target
			)
		)
Пример #19
0
	def __init__ (self, asn, rate, community=None):
		self.asn = asn
		self.rate = rate
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2sHf",
				self._subtype(),
				asn,rate
			)
		)
Пример #20
0
	def __init__ (self, asn, target, community=None):
		self.asn = asn
		self.target = target
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!BBHL",
				0x80,0x08,
				asn,target
			)
		)
Пример #21
0
	def __init__ (self, asn, rate, community=None):
		self.asn = asn
		self.rate = rate
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!BBHf",
				0x80,0x06,
				asn,rate
			)
		)
Пример #22
0
	def __init__ (self, asn, target, community=None):
		self.asn = asn
		self.target = target
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2sHL",
				self._subtype(),
				asn,target
			)
		)
Пример #23
0
	def __init__ (self, order, reserved=0, community=None):
		self.order = order
		self.reserved = reserved

		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2sIH",
				self._subtype(),
				order,reserved
			)
		)
Пример #24
0
	def __init__ (self, sample, terminal, community=None):
		self.sample = sample
		self.terminal = terminal
		bitmask = self._sample[sample] | self._terminal[terminal]
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				'!2sLBB',
				self._subtype(),
				0,0,bitmask
			)
		)
Пример #25
0
	def __init__ (self, sequence, sticky=False, community=None):
		self.sequence = sequence
		self.sticky = sticky
		ExtendedCommunity.__init__(
			self,
			community if community else pack(
				'!2sBxI',
				self._subtype(transitive=True),
				1 if sticky else 0,
				sequence
			)
		)
Пример #26
0
	def __init__ (self, ip, copy, community=None):
		self.ip = ip
		self.copy = copy
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2s4sH",
				self._subtype(),
				ip.pack(),
				1 if copy else 0
			)
		)
Пример #27
0
	def __init__ (self, trans, asn, target, direction, community=None):
		self.asn = asn
		self.target = target
		self.direction = direction
		self.transitive = trans
		new_target = (direction << 14) + target
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!2sLH",
				self._subtype(self.transitive),
				asn,new_target
			)
		)
Пример #28
0
	def __init__ (self, encaps, control, mtu, reserved, community=None):
		self.encaps = encaps
		self.control = control
		self.mtu = mtu
		self.reserved = reserved
		# reserved is called preference in draft-ietf-l2vpn-vpls-multihoming-07
		ExtendedCommunity.__init__(
			self,
			community if community is not None else pack(
				"!BBBBHH",
				0x80,0x0A,
				encaps,control,
				mtu,reserved
			)
		)
Пример #29
0
 def __init__(self, asn, speed, community=None):
     self.asn = asn
     self.speed = speed
     ExtendedCommunity.__init__(
         self,
         community if community is not None else pack("!Hf", asn, speed))
Пример #30
0
 def __init__(self, tunnel_type, community=None):
     self.tunnel_type = tunnel_type
     ExtendedCommunity.__init__(
         self, community if community is not None else pack(
             "!BBLH", 0x03, 0x0C, 0, self.tunnel_type))
Пример #31
0
 def __init__(self, dscp, community=None):
     self.dscp = dscp
     ExtendedCommunity.__init__(
         self, community if community is not None else pack(
             "!BBLBB", 0x80, 0x09, 0, 0, dscp))
Пример #32
0
 def __init__(self, copy, community=None):
     self.copy = copy
     ExtendedCommunity.__init__(
         self, community if community is not None else pack(
             "!BBLH", 0x80, 0x00, 0, 1 if copy else 0))
Пример #33
0
 def __init__(self, asn, rate, community=None):
     self.asn = asn
     self.rate = rate
     ExtendedCommunity.__init__(
         self, community if community is not None else pack(
             "!BBHf", 0x80, 0x06, asn, rate))
Пример #34
0
 def __init__(self, asn, target, community=None):
     self.asn = asn
     self.target = target
     ExtendedCommunity.__init__(
         self, community if community is not None else pack(
             "!BBHL", 0x80, 0x08, asn, target))
Пример #35
0
	def __init__ (self,encaps,control,mtu,reserved,community=None):
		self.encaps = encaps
		self.control = control
		self.mtu = mtu
		self.reserved = reserved
		ExtendedCommunity.__init__(self,community if community is not None else pack("!BBLH",0x80,0x0A,0,self.tunnel_type))