Beispiel #1
0
	def exit (self, tokeniser):
		asn = self.extract_anonymous('asn',tokeniser)
		if asn:
			if 'asn' in self.content:
				raise RaisedSession(tokeniser,"can not have amed and anonymous 'asn' in a session")
			self.content['asn'] = asn

		if 'asn' not in self.content:
			raise RaisedSession(tokeniser,"section is missing a 'asn' section")

		capability = self.extract_anonymous('capability',tokeniser)
		if capability:
			if 'capability' in self.content:
				raise RaisedSession(tokeniser,"can not have amed and anonymous 'capability' in a session")
			self.content['capability'] = capability

		if 'capability' not in self.content:
			raise RaisedSession(tokeniser,"section is missing a 'capability' section")

		if 'router-id' not in self.content:
			# 0.0.0.0 is now a invlid router-id so it will be replaced by the bind ip
			self.content['router-id'] = ip(lambda:'0.0.0.0')

		if 'hold-time' not in self.content:
			self.content['hold-time'] = holdtime(lambda:'180')
Beispiel #2
0
    def exit(self, tokeniser):
        asn = self.extract_anonymous('asn', tokeniser)
        if asn:
            if 'asn' in self.content:
                raise RaisedSession(
                    tokeniser,
                    "can not have amed and anonymous 'asn' in a session")
            self.content['asn'] = asn

        if 'asn' not in self.content:
            raise RaisedSession(tokeniser,
                                "section is missing a 'asn' section")

        capability = self.extract_anonymous('capability', tokeniser)
        if capability:
            if 'capability' in self.content:
                raise RaisedSession(
                    tokeniser,
                    "can not have amed and anonymous 'capability' in a session"
                )
            self.content['capability'] = capability

        if 'capability' not in self.content:
            raise RaisedSession(tokeniser,
                                "section is missing a 'capability' section")

        if 'router-id' not in self.content:
            # 0.0.0.0 is now a invlid router-id so it will be replaced by the bind ip
            self.content['router-id'] = ip(lambda: '0.0.0.0')

        if 'hold-time' not in self.content:
            self.content['hold-time'] = holdtime(lambda: '180')
Beispiel #3
0
 def tcp_connect(self, tokeniser):
     try:
         self.content['tcp-connect'] = ip(tokeniser)
     except ValueError, exc:
         raise RaisedNeighbor(
             tokeniser, 'could not parse tcp connect ip, %s' % str(exc))
Beispiel #4
0
 def tcp_bind(self, tokeniser):
     try:
         self.content['tcp-bind'] = ip(tokeniser)
     except ValueError, exc:
         raise RaisedNeighbor(tokeniser,
                              'could not parse tcp bind ip, %s' % str(exc))
Beispiel #5
0
	def tcp_connect (self, tokeniser):
		try:
			self.content['tcp-connect'] = ip(tokeniser)
		except ValueError,exc:
			raise RaisedNeighbor(tokeniser,'could not parse tcp connect ip, %s' % str(exc))
Beispiel #6
0
	def tcp_bind (self, tokeniser):
		try:
			self.content['tcp-bind'] = ip(tokeniser)
		except ValueError,exc:
			raise RaisedNeighbor(tokeniser,'could not parse tcp bind ip, %s' % str(exc))
Beispiel #7
0
	def router_id (self, tokeniser):
		try:
			self.content['router-id'] = ip(tokeniser)
		except ValueError,exc:
			raise RaisedSession(tokeniser,'could not parse router-id, %s' % str(exc))
Beispiel #8
0
 def router_id(self, tokeniser):
     try:
         self.content['router-id'] = ip(tokeniser)
     except ValueError, exc:
         raise RaisedSession(tokeniser,
                             'could not parse router-id, %s' % str(exc))