예제 #1
0
파일: XMMRCtl.cpp 프로젝트: ja7ude/XMMT
void CXMMRCtrl::DoPropExchange(CPropExchange* pPX)
{
	ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
	COleControl::DoPropExchange(pPX);

	PX_Bool(pPX, _T("bInitialClose"), m_bInitialClose, TRUE);
	PX_Bool(pPX, _T("bConfirmClose"), m_bConfirmClose, TRUE);
	PX_Bool(pPX, _T("bNotifyFFT"), m_bNotifyFFT, TRUE);
	PX_Bool(pPX, _T("bNotifyXY"), m_bNotifyXY, TRUE);
	PX_Bool(pPX, _T("bNotifyComChange"), m_bNotifyComChange, TRUE);
	PX_Bool(pPX, _T("bTranslateAllMessages"), m_bTranslateAllMessages, FALSE);
	PX_Bool(pPX, _T("bRemoveUselessMessage"), m_bRemoveUselessMessage, TRUE);
#ifdef _DEBUG
	PX_String(pPX, _T("InvokeCommand"), m_InvokeCommand, _T("D:\\MMTTY\\MMTTY.EXE -r"));
#else
	PX_String(pPX, _T("InvokeCommand"), m_InvokeCommand, _T("MMTTY.EXE -m"));
#endif
	PX_String(pPX, _T("ComName"), m_ComName, _T(""));
	PX_String(pPX, _T("RadioName"), m_RadioName, _T(""));
	PX_String(pPX, _T("Title"), m_Title, _T(""));
	PX_Long(pPX, _T("smpFFT"), m_smpFFT, FALSE);
	PX_Long(pPX, _T("DelayInvoke"), m_delayInvoke, 0);

#if 0
	if( pPX->IsLoading() ){
		DecodeOptions();
	}
#endif
}
예제 #2
0
파일: XMMRCtl.cpp 프로젝트: ja7ude/XMMT
void CXMMRCtrl::SetInvokeCommand(LPCTSTR lpszNewValue) 
{
	if( lstrcmp(m_InvokeCommand, lpszNewValue) ){
		m_InvokeCommand = lpszNewValue;
		if( m_bConnected ) DecodeOptions();
		SetModifiedFlag();
	}
}
예제 #3
0
파일: XMMRCtl.cpp 프로젝트: ja7ude/XMMT
//---------------------------------------------------------------------------
void CXMMRCtrl::OpenMmtty(void)
{
	CloseMmtty(TRUE);
	m_hMMWnd = HWND_BROADCAST;

	DecodeOptions();
	if( m_pCom == &m_InternalArray ){
		ChangeCommonMemory(m_CommonMemory);
	}
	// アプリケーションを起動/監視するためのタイマーを起動します。
	m_TimerMode = 0;
	m_nTimerID = SetTimer(1, 100, NULL);
	m_TimerCount = m_delayInvoke / 100;
}
예제 #4
0
void dhcp_server( void ) {
	char			*iface_pref, *euid_pref, *dbhost_pref, *force_chroot;
	char			*dhcp_high_load_c;
	int			dhcp_high_load;
	dhcp_message		message;
	u_int32_t		server_ip;
	struct passwd		*pass_struct;
	int			retval = 0, cc = 0, sentreply;

	iface_pref = my_GetDHCPint();
	server_ip = getInterfaceIP( iface_pref );
	init_DHCP_Socket( server_ip );

//	euid_pref = GetConfigVar( "effective-userid" );
//	pass_struct = getpwnam( euid_pref );
//	if (pass_struct) {
//		seteuid( pass_struct->pw_uid );
//		setegid( pass_struct->pw_gid );
//	}

	dbhost_pref = GetConfigVar( "mysql-host" );
	force_chroot = GetConfigVar( "force-localhost-chroot" );
//	if (strcmp(dbhost_pref,"localhost") || !strcmp(force_chroot, "yes")) {
//		// We cannot chroot if connect to the DB via
//		// a unix socket vs tcp
//		chroot( CHROOT_PATH );
//	}

	dhcp_high_load_c = GetConfigVar( "dhcp-high-load" );
	if (*dhcp_high_load_c == ' ') { dhcp_high_load_c = "16"; }
	dhcp_high_load = strtoul( dhcp_high_load_c, NULL, 10 );
	if (dhcp_high_load <= 4) { dhcp_high_load = 4; }
	if (dhcp_high_load >= 128) { dhcp_high_load = 128; }
	my_Check_Load( dhcp_high_load );

	InitSQLconnection();

	my_syslog( MLOG_DHCP, "docsis_server DHCP version %s activated", VERSION);
	Clear_Remote_Commands();

	while (dhcpd_exit_flag) { /* loop until universe collapses */
		/* update the PID file */
		update_pid_file();

		/* Clear Message Struct */
		memset( &message, 0, sizeof( dhcp_message ) );

		retval = getPacket( &message );
		if (retval == -2) Check_Remote_Commands();
		if (retval < 0) {
			// ping the MySQL server
			my_SQL_Ping();
			continue;
		}
		message.server_ip = server_ip;

		if (Check_Canary) { fprintf(stderr,"canary A died %llu %llu %llu "
				" %llu %llu %llu  %llu %llu %llu\n",Canaries); continue; }

 		DecodeOptions( &message );
		if (message.in_opts.message_type == 0) {
			message.in_opts.message_type = DHCP_REQUEST;
		}

		if (Check_Canary) { fprintf(stderr,"canary B died %llu %llu %llu "
				" %llu %llu %llu  %llu %llu %llu\n",Canaries); continue; }

		sentreply = 0;
		switch( message.in_opts.message_type ) {
		case DHCP_DISCOVER:
			sentreply = send_Offer( &message );
			break;

		case DHCP_REQUEST:
			sentreply = send_ACK( &message );
			break;

		case DHCP_RELEASE:
			/* checkRelease( &message ); */
			break;
		case DHCP_INFORM:
			sentreply = send_ACK( &message );
			break;

		case DHCP_DECLINE:
			/* ignore */
			break;

		case DHCP_LEASE_QUERY:	/* wierd ubR thingy  0x0d */
			sentreply = leaseQuery( &message );
			break;

		default: {
			my_syslog(LOG_WARNING, "unsupported DHCP message (%02x) %s -- ignoring",
				message.in_opts.message_type, message.s_macaddr );
			}
		}

		if (Check_Canary) { fprintf(stderr,"canary C died %llu %llu %llu "
				" %llu %llu %llu  %llu %llu %llu\n",Canaries); continue; }

		if (sentreply) my_Check_Load( dhcp_high_load );
		Check_Remote_Commands();
	}

	my_syslog(LOG_INFO, "exit");
	Flush_ALL_SQL_Updates();
	closelog();
	exit(0);
}
예제 #5
0
QVariant QJson::decode(const QString &json, QString *errorMessage)
{
	return decode(json, DecodeOptions(), errorMessage);
}