static	char	sccsid[]="%Z% %M% %I% %E% %U%";
/******************************************************************************
*                                                                             *
*      処理目的　　：  エラーパケット書き出し処理                             *
*                                                                             *
*      関数名　　　：　int cl_make_error_packet()                             *
*                                                                             *
*      引き数      ：　なし                                                   *
*                                                                             *
*                                                                             *
*      戻り値　　　：　ERROR                                    　            *
*                      NORMAL                                                 *
*                                                                             *
*      処理概要　　：　                                                       *
*                                                                             *
******************************************************************************/
#include "colmn.h"
extern CLPRTBL *pCLprocTable;
extern GlobalCt *pGlobTable;

int cl_make_error_packet()
{
	FreamCB    *pFRCB;
	TrmToSrv   *pwTTS,*pWrTTS;
	AKAMSGCOM  *tpMsgCom, *tpSendMsgCom;

	if (!(pWrTTS=(TrmToSrv *)Malloc(sizeof(TrmToSrv)))) return ERROR;
	/* パケットヘッダー作成     */
	tpMsgCom = (AKAMSGCOM *)pCLprocTable->CmdPacketp;
	pwTTS = (TrmToSrv *)tpMsgCom->msg_pmsg;
	memcpy(pWrTTS->userid,pwTTS->userid,sizeof(pwTTS->userid));
	pWrTTS->commandid = pwTTS->commandid;
	pWrTTS->parmnum = htonl(pGlobTable->Return);
	tpSendMsgCom = (AKAMSGCOM *)pCLprocTable->WrPacketp;
	tpSendMsgCom->msg_pmsg = (char *)pWrTTS;
	tpSendMsgCom->msg_mlen = sizeof(TrmToSrv);
	tpSendMsgCom->msg_filc = 0;

	return NORMAL;
}
