# 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: TestCase.py
# class TestCase:
# 	TC_API_VERSION = 0.3
# 	TC_INIT   = TestResult.TR_INIT
# 	TC_PASSED = TestResult.TR_PASSED
# 	TC_FAILED = TestResult.TR_FAILED
# 	TC_WARN   = TestResult.TR_WARN
# 	TC_CAUT   = TestResult.TR_CAUT
# 	TC_CANC   = TestResult.TR_CANC
# 	TC_ERROR  = TestResult.TR_ERROR
# 	def __init__(self):
# 	def __str__(self):
# 	def run(self):
# 	def config(self):
# 	def addResult(self, res, reason, name=None, descr=None):
# 	def getEndResults(self):
# 	def getOneResult(self):
# 	def userInteraction(self, message, cancel=True):
# 	def addResource(self, resource):
# 	def findNEH(self, _transport, _lip, _lport, _rip, _rport):
# 	def findFEH(self, _filename):
# 	def newDialog(self, neh=None):
# 	def newTransaction(self, dia, mes=None):
# 	def addMessage(self, message, dia=None, trans=None, neh=None):
# 	def parseMessage(self, _message):
# 	def addEvent(self, _event, neh):
# 	def getLastDialog(self, dia=None):
# 	def getLastTransaction(self, dia=None, trans=None):
# 	def getLastRequest(self, dia=None, trans=None, mes=None):
# 	def getLastReply(self, dia=None, trans=None, mes=None):
# 	def getDiaTrans(self, mes):
# 	def createReply(self, code, reason, mes=None, createEvent=True):
# 	def createChallenge(self, mes=None, realm=None, qop=False, algorithm="MD5", stale=None, proxy=False):
# 	def checkAuthResponse(self, mes=None, username=None, password=None, realm=None, proxy=False):
# 	def readMessageFromNetwork(self, _NetworkEventHandler=None, StartTimeout=None, CatchTimeout=True, TimeoutError=True, ignoreRequests=False, ignoreReplies=False, RequestMethod=None):
# 	def readReplyFromNetwork(self, _NetworkEventHandler=None, StartTimeout=None, CatchTimeout=True, TimeoutError=True):
# 	def readRequestFromNetwork(self, _NetworkEventHandler=None, StartTimeout=None, CatchTimeout=True, TimeoutError=True, RequestMethod=None):
# 	def setBody(self, body, mes=None):
# 	def setOnHoldBody(self, mes=None):
# 	def setMediaBody(self, mes=None, sock=None, checksend=True):
# 	def createRequest(self, method, ruri=None, trans=None, dia=None, createEvent=True, neh=None):
# 	def writeMessageToNetwork(self, _NetworkEventHandler=None, Message=None):
# 	def reactOn(self, message):
# 	def onINVITE(self, message):
# 	def onACK(self, message):
# 	def onBYE(self, message):
# 	def onREGISTER(self, message):
# 	def onDefaultMethod(self, message):
# 	def onDefaultCode(self, message):
# 	def on100(self, message):
# 	def on486(self, message):
# 	def getParsedHeaderInstance(self, name):
# 	def reTry(self, message):
# 	def getUniqueTimestamp(self):


from HeaderFieldHandler import HeaderFieldHandler
from SCException import SCNotImplemented, HFHException
from TestCase import TestResult
import Log
				if ((eq != -1 and eq < cm) or (eq != -1 and cm == -1)):
					name = v[:eq]
				else:
					rem.append(v)
					break
				# find the value
				if ((lq != -1) and ((lq < cm) or (cm == -1))):
					rq = v[lq+1:].find("\"")
					if (rq != -1):
						nameval = v[lq:lq+2+rq]
						oldv = v[:lq+1+rq]
						v = v[lq+2+rq:].lstrip()
						if (v.startswith(",")):
							v = v[1:].lstrip()
					else:
						rem.append(v)
				elif ((eq != -1) and ((eq < cm) or (cm == -1))):
					if cm == -1:
						nameval = v[eq+1:]
						oldv = v
						v = ""
					else:
						nameval = v[eq+1:cm]
						oldv = v[:cm]
						v = v[cm+1:].lstrip()
				else:
					rem.append(v)
				# assign the value
				if (name.lower() == "username"):
					if not (name == "username"):

# 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: TestCase.py
# class TestCase:
# 	TC_API_VERSION = 0.3
# 	TC_INIT   = TestResult.TR_INIT
# 	TC_PASSED = TestResult.TR_PASSED
# 	TC_FAILED = TestResult.TR_FAILED
# 	TC_WARN   = TestResult.TR_WARN
# 	TC_CAUT   = TestResult.TR_CAUT
# 	TC_CANC   = TestResult.TR_CANC
# 	TC_ERROR  = TestResult.TR_ERROR
# 	def __init__(self):
# 	def __str__(self):
# 	def run(self):
# 	def config(self):
# 	def addResult(self, res, reason, name=None, descr=None):
# 	def getEndResults(self):
# 	def getOneResult(self):
# 	def userInteraction(self, message, cancel=True):
# 	def addResource(self, resource):
# 	def findNEH(self, _transport, _lip, _lport, _rip, _rport):
# 	def findFEH(self, _filename):
# 	def newDialog(self, neh=None):
# 	def newTransaction(self, dia, mes=None):
# 	def addMessage(self, message, dia=None, trans=None, neh=None):
# 	def parseMessage(self, _message):
# 	def addEvent(self, _event, neh):
# 	def getLastDialog(self, dia=None):
# 	def getLastTransaction(self, dia=None, trans=None):
# 	def getLastRequest(self, dia=None, trans=None, mes=None):
# 	def getLastReply(self, dia=None, trans=None, mes=None):
# 	def getDiaTrans(self, mes):
# 	def createReply(self, code, reason, mes=None, createEvent=True):
# 	def createChallenge(self, mes=None, realm=None, qop=False, algorithm="MD5", stale=None, proxy=False):
# 	def checkAuthResponse(self, mes=None, username=None, password=None, realm=None, proxy=False):
# 	def readMessageFromNetwork(self, _NetworkEventHandler=None, StartTimeout=None, CatchTimeout=True, TimeoutError=True, ignoreRequests=False, ignoreReplies=False, RequestMethod=None):
# 	def readReplyFromNetwork(self, _NetworkEventHandler=None, StartTimeout=None, CatchTimeout=True, TimeoutError=True):
# 	def readRequestFromNetwork(self, _NetworkEventHandler=None, StartTimeout=None, CatchTimeout=True, TimeoutError=True, RequestMethod=None):
# 	def setBody(self, body, mes=None):
# 	def setOnHoldBody(self, mes=None):
# 	def setMediaBody(self, mes=None, sock=None, checksend=True):
# 	def createRequest(self, method, ruri=None, trans=None, dia=None, createEvent=True, neh=None):
# 	def writeMessageToNetwork(self, _NetworkEventHandler=None, Message=None):
# 	def reactOn(self, message):
# 	def onINVITE(self, message):
# 	def onACK(self, message):
# 	def onBYE(self, message):
# 	def onREGISTER(self, message):
# 	def onDefaultMethod(self, message):
# 	def onDefaultCode(self, message):
# 	def on100(self, message):
# 	def on486(self, message):
# 	def getParsedHeaderInstance(self, name):
# 	def reTry(self, message):
# 	def getUniqueTimestamp(self):


# Path: HFH/Authorization.py
from HeaderFieldHandler import HeaderFieldHandler
from SCException import SCNotImplemented, HFHException
from TestCase import TestResult
import Log

				if ((eq != -1 and eq < cm) or (eq != -1 and cm == -1)):
					name = v[:eq]
				else:
					rem.append(v)
					break
				# find the value
				if ((lq != -1) and ((lq < cm) or (cm == -1))):
					rq = v[lq+1:].find("\"")
					if (rq != -1):
						nameval = v[lq:lq+2+rq]
						oldv = v[:lq+1+rq]
						v = v[lq+2+rq:].lstrip()
						if (v.startswith(",")):
							v = v[1:].lstrip()
					else:
						rem.append(v)
				elif ((eq != -1) and ((eq < cm) or (cm == -1))):
					if cm == -1:
						nameval = v[eq+1:]
						oldv = v
						v = ""
					else:
						nameval = v[eq+1:cm]
						oldv = v[:cm]
						v = v[cm+1:].lstrip()
				else:
					rem.append(v)
				# assign the value
				if (name.lower() == "username"):
					if not (name == "username"):

						res.append(TestResult(TestResult.TR_CAUT, "Authorization parameter 'username' doesnt conform to BNF in RFC3261"))