# Path: SCException.py
# class SCNotImplemented (SCException):
# 	"""See SCException. Called if implementation is missing."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)
# 
# class HFHException(SCException):
# 	"""See SCException. Called for exceptions during parsing header fields."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)
# 
# Path: NetworkEventHandler.py
# def compareHostNames(name1, name2):
# 	"""Compares the both given hostnames (DNS names or IPs) and
# 	returns True if they are equal (except DNS aliases), False otherwise.
# 	"""
# 	#FIXME IPs of aliases could be detected as not equal
# 	# the result lists should be compared each one by one
# 	if (name1 is None) or (name2 is None):
# 		return False
# 	try:
# 		list1 = socket.getaddrinfo(name1, 0, socket.AF_UNSPEC)
# 		ip1 = list1[0][4][0]
# 	except socket.gaierror:
# 		ip1 = name1
# 	try:
# 		list2 = socket.getaddrinfo(name2, 0, socket.AF_UNSPEC)
# 		ip2 = list2[0][4][0]
# 	except socket.gaierror:
# 		ip2 = name2
# 	if ip1 == ip2:
# 		return True
# 	else:
# 		return False


from HeaderFieldHandler import HeaderFieldHandler
from SCException import SCNotImplemented, HFHException
from NetworkEventHandler import compareHostNames
			else:
				self.port = hp[sep+1:]
		else:
			self.host = hp.rstrip()
		if (pms is not None):
			plist = pms.split(";")
			for i in plist:
				s = i.replace("\t", "").strip()
				eq = s.find("=")
				if (eq != -1):
					name = s[:eq]
					value = s[eq+1:]
				else:
					name = s
					value = ""
				name.lower()
				if (name == "ttl"):
					self.ttl = value
				elif (name == "maddr"):
					self.maddr = value
				elif (name == "received"):
					self.received = value
				elif (name == "branch"):
					self.branch = value
				elif (name == "rport"):
					if value == '':
						self.rport = "empty"
					else:
						self.rport = value
				else:

# Path: SCException.py
# class SCNotImplemented (SCException):
# 	"""See SCException. Called if implementation is missing."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)
# 
# class HFHException(SCException):
# 	"""See SCException. Called for exceptions during parsing header fields."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)
# 
# Path: NetworkEventHandler.py
# def compareHostNames(name1, name2):
# 	"""Compares the both given hostnames (DNS names or IPs) and
# 	returns True if they are equal (except DNS aliases), False otherwise.
# 	"""
# 	#FIXME IPs of aliases could be detected as not equal
# 	# the result lists should be compared each one by one
# 	if (name1 is None) or (name2 is None):
# 		return False
# 	try:
# 		list1 = socket.getaddrinfo(name1, 0, socket.AF_UNSPEC)
# 		ip1 = list1[0][4][0]
# 	except socket.gaierror:
# 		ip1 = name1
# 	try:
# 		list2 = socket.getaddrinfo(name2, 0, socket.AF_UNSPEC)
# 		ip2 = list2[0][4][0]
# 	except socket.gaierror:
# 		ip2 = name2
# 	if ip1 == ip2:
# 		return True
# 	else:
# 		return False


# Path: HFH/Via.py
from HeaderFieldHandler import HeaderFieldHandler
from SCException import SCNotImplemented, HFHException
from NetworkEventHandler import compareHostNames

			else:
				self.port = hp[sep+1:]
		else:
			self.host = hp.rstrip()
		if (pms is not None):
			plist = pms.split(";")
			for i in plist:
				s = i.replace("\t", "").strip()
				eq = s.find("=")
				if (eq != -1):
					name = s[:eq]
					value = s[eq+1:]
				else:
					name = s
					value = ""
				name.lower()
				if (name == "ttl"):
					self.ttl = value
				elif (name == "maddr"):
					self.maddr = value
				elif (name == "received"):
					self.received = value
				elif (name == "branch"):
					self.branch = value
				elif (name == "rport"):
					if value == '':
						self.rport = "empty"
					else:
						self.rport = value
				else:

					if value == '':