# 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)
# 
# 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
from NetworkEventHandler import compareHostNames
import urllib
		self.password = None
		self.host = None
		self.ipv6 = False
		self.port = None
		self.params = []
		self.headers = []
		if value is not None:
			self.parse(value)

	def __str__(self):
		return '[protocol:\'' + str(self.protocol) + '\', ' \
				+ 'username:\'' + str(self.username) + '\', ' \
				+ 'password:\'' + str(self.password) + '\', ' \
				+ 'host:\'' + str(self.host) + '\', ' \
				+ 'ipv6:\'' + str(self.ipv6) + '\', ' \
				+ 'port:\'' + str(self.port) + '\', ' \
				+ 'params:\'' + str(self.params) + '\', ' \
				+ 'headers:\'' + str(self.headers) + '\']'

	def __cmp__(self, other):
		ret = 0
		if not isinstance(other, sip_uri):
			return -1
		if self.protocol != other.protocol:
			ret = ret + 1
		if self.username != other.username:
			ret = ret + 1
		if self.password != other.password:
			ret = ret + 1
		if not compareHostNames(self.host, other.host):

# 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)
# 
# 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/sip_uri.py
from HeaderFieldHandler import HeaderFieldHandler
from SCException import SCNotImplemented
from NetworkEventHandler import compareHostNames
import urllib

		self.password = None
		self.host = None
		self.ipv6 = False
		self.port = None
		self.params = []
		self.headers = []
		if value is not None:
			self.parse(value)

	def __str__(self):
		return '[protocol:\'' + str(self.protocol) + '\', ' \
				+ 'username:\'' + str(self.username) + '\', ' \
				+ 'password:\'' + str(self.password) + '\', ' \
				+ 'host:\'' + str(self.host) + '\', ' \
				+ 'ipv6:\'' + str(self.ipv6) + '\', ' \
				+ 'port:\'' + str(self.port) + '\', ' \
				+ 'params:\'' + str(self.params) + '\', ' \
				+ 'headers:\'' + str(self.headers) + '\']'

	def __cmp__(self, other):
		ret = 0
		if not isinstance(other, sip_uri):
			return -1
		if self.protocol != other.protocol:
			ret = ret + 1
		if self.username != other.username:
			ret = ret + 1
		if self.password != other.password:
			ret = ret + 1
		if not compareHostNames(self.host, other.host):

			ret = ret + 1