Example #1
0
// send Discovery Response to the host at the specified address
CWBool CWAssembleDiscoveryResponse(CWProtocolMessage **messagesPtr, int seqNum, unsigned int WTPID) {
	CWProtocolMessage *msgElems= NULL;
	int msgElemCount = 3;
	CWProtocolMessage *msgElemsBinding= NULL;
	int msgElemBindingCount=0;
	int fragmentsNum;
	int k = -1;
	if(messagesPtr == NULL) return CWErrorRaise(CW_ERROR_WRONG_ARG, NULL);
	
	if(CWACSupportIPv6()) {
		msgElemCount++;
	}
	wid_syslog_debug_debug(WID_WTPINFO,"Assemble Discovery Response");
	CW_CREATE_PROTOCOL_MSG_ARRAY_ERR(msgElems, msgElemCount, return CWErrorRaise(CW_ERROR_OUT_OF_MEMORY, NULL););
/* send Discovery Response to the host at the specified address */
CWBool CWAssembleDiscoveryResponse(CWProtocolMessage ** messagesPtr, int seqNum)
{

	CWProtocolMessage *msgElems = NULL;
	int msgElemCount = 4;
	CWProtocolMessage *msgElemsBinding = NULL;
	int msgElemBindingCount = 0;
	int fragmentsNum;

	int k = -1;
	if (messagesPtr == NULL)
		return CWErrorRaise(CW_ERROR_WRONG_ARG, NULL);

	if (CWACSupportIPv6()) {
		msgElemCount++;
	}

	CWLog("Send Discovery Response");
	CW_CREATE_PROTOCOL_MSG_ARRAY_ERR(msgElems, msgElemCount, return CWErrorRaise(CW_ERROR_OUT_OF_MEMORY, NULL);
	    );