# Path: TestResult.py
# class TestResult:
# 	"""This class just provides a generic container for test results, with
# 	an integer as test result and a string as descriptionale reason for
# 	this result.
# 	"""
# 
# 	TR_INIT = 0
# 	TR_PASSED = 1
# 	TR_FAILED = 2
# 	TR_WARN = 4
# 	TR_CAUT = 8
# 	TR_CANC = 16
# 	TR_ERROR = 32
# 
# 	def __init__(self, res=None, reason=None):
# 		self.name = None
# 		self.description = None
# 		self.result = TestResult.TR_INIT
# 		self.reason = None
# 		if res is not None and reason is not None:
# 			self.setResult(res, reason)
# 
# 	def __str__(self):
# 		return "[name:'" + str(self.name) + "', " \
# 				"description:'" + str(self.description) + "', " \
# 				"result:'" + getResultString(self.result) + "', " \
# 				"reason:'" + str(self.reason) + "']"
# 
# 	def setResult(self, res, reason):
# 		"""Sets the given result number and reason phrase for the instance."""
# 		if (res < TestResult.TR_INIT) or (res > TestResult.TR_ERROR):
# 			raise SCException("TestResult", "setResult", "unknown/unsupported test case result")
# 		self.result = res
# 		self.reason = reason
# 
# Path: SCException.py
# class SCException(Exception):
# 	"""Generic internal exception class. Consits out of class name, function
# 	name and the reason phrase.
# 	"""
# 
# 	def __init__(self, cls, funct, reason):
# 		Exception.__init__(self)
# 		self.cls = cls
# 		self.funct = funct
# 		self.reason = reason
# 
# 	def __str__(self):
# 		return str(self.cls) + '.' + str(self.funct) + '(): ' + str(self.reason)
# 
# class SCNotImplemented (SCException):
# 	"""See SCException. Called if implementation is missing."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)


import SipEvent, Log, Helper
from TestResult import TestResult
from SCException import SCException, SCNotImplemented
		if self.parsedHeader.has_key(hfn_m):
			return self.parsedHeader[hfn_m]
		else:
			return None
	
	def setParsedHeaderValue(self, hfName, hfValue):
		"""Sets the given object as the parsed header field.
		"""
		hfn_m = Helper.getMappedHFH(hfName)
		if hfn_m is None:
			Log.logDebug("SipMessage.setParsedHeaderValue(): unable to map HFH: " + str(hfName), 3)
			hfn_m = hfName
		self.parsedHeader[hfn_m] = hfValue

	def removeParsedHeaderField(self, hfName):
		"""Removes the object with the given name from the list
		of parsed haeder fields.
		"""
		if self.parsedHeader.has_key (hfName.replace("-", "").capitalize()):
			del self.parsedHeader[hfName.replace("-", "").capitalize()]
	
	def setEventAddresses(self, Src, Dst):
		"""Sets the source and destination address of the event in the
		message.
		"""
		if self.event is None:
			raise SCException("SipMessage", "setEventAddresses", "missing event to set addresses")
		if len(Src) != 3:
			raise SCException("SipMessage", "setEventAddresses", "source address requires 3 parameter, got: " + str(Src))
		if len(Dst) != 2:

# Path: TestResult.py
# class TestResult:
# 	"""This class just provides a generic container for test results, with
# 	an integer as test result and a string as descriptionale reason for
# 	this result.
# 	"""
# 
# 	TR_INIT = 0
# 	TR_PASSED = 1
# 	TR_FAILED = 2
# 	TR_WARN = 4
# 	TR_CAUT = 8
# 	TR_CANC = 16
# 	TR_ERROR = 32
# 
# 	def __init__(self, res=None, reason=None):
# 		self.name = None
# 		self.description = None
# 		self.result = TestResult.TR_INIT
# 		self.reason = None
# 		if res is not None and reason is not None:
# 			self.setResult(res, reason)
# 
# 	def __str__(self):
# 		return "[name:'" + str(self.name) + "', " \
# 				"description:'" + str(self.description) + "', " \
# 				"result:'" + getResultString(self.result) + "', " \
# 				"reason:'" + str(self.reason) + "']"
# 
# 	def setResult(self, res, reason):
# 		"""Sets the given result number and reason phrase for the instance."""
# 		if (res < TestResult.TR_INIT) or (res > TestResult.TR_ERROR):
# 			raise SCException("TestResult", "setResult", "unknown/unsupported test case result")
# 		self.result = res
# 		self.reason = reason
# 
# Path: SCException.py
# class SCException(Exception):
# 	"""Generic internal exception class. Consits out of class name, function
# 	name and the reason phrase.
# 	"""
# 
# 	def __init__(self, cls, funct, reason):
# 		Exception.__init__(self)
# 		self.cls = cls
# 		self.funct = funct
# 		self.reason = reason
# 
# 	def __str__(self):
# 		return str(self.cls) + '.' + str(self.funct) + '(): ' + str(self.reason)
# 
# class SCNotImplemented (SCException):
# 	"""See SCException. Called if implementation is missing."""
# 
# 	def __init__(self, cls, function, reason):
# 		SCException.__init__(self, cls, function, reason)


# Path: SipMessage.py
import SipEvent, Log, Helper
from TestResult import TestResult
from SCException import SCException, SCNotImplemented

		if self.parsedHeader.has_key(hfn_m):
			return self.parsedHeader[hfn_m]
		else:
			return None
	
	def setParsedHeaderValue(self, hfName, hfValue):
		"""Sets the given object as the parsed header field.
		"""
		hfn_m = Helper.getMappedHFH(hfName)
		if hfn_m is None:
			Log.logDebug("SipMessage.setParsedHeaderValue(): unable to map HFH: " + str(hfName), 3)
			hfn_m = hfName
		self.parsedHeader[hfn_m] = hfValue

	def removeParsedHeaderField(self, hfName):
		"""Removes the object with the given name from the list
		of parsed haeder fields.
		"""
		if self.parsedHeader.has_key (hfName.replace("-", "").capitalize()):
			del self.parsedHeader[hfName.replace("-", "").capitalize()]
	
	def setEventAddresses(self, Src, Dst):
		"""Sets the source and destination address of the event in the
		message.
		"""
		if self.event is None:
			raise SCException("SipMessage", "setEventAddresses", "missing event to set addresses")
		if len(Src) != 3:
			raise SCException("SipMessage", "setEventAddresses", "source address requires 3 parameter, got: " + str(Src))
		if len(Dst) != 2:

			raise SCException("SipMessage", "setEventAddresses", "destination address requires 2 parameter, got: " + str(Dst))