src/Cedar/NM.c
// Dialog proc for the push routing option

Dialog proc for the push routing option
Dialog proc for the push routing option
UINT NmEditPushRouteProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param)
{
	SM_HUB *r = (SM_HUB *)param;
	char *str = NULL;
	if (hWnd == NULL)
	{
		return 0;
	}
	switch (msg)
	{
	case WM_INITDIALOG:
		SetTextA(hWnd, E_TEXT, r->CurrentPushRouteStr);
		Focus(hWnd, E_TEXT);
		SetIcon(hWnd, 0, ICO_PROTOCOL);
		break;
	case WM_COMMAND:
		switch (wParam)
		{
		case IDOK:
			str = GetTextA(hWnd, E_TEXT);
			if (str != NULL)
			{
				bool ok = true;
				if (CheckClasslessRouteTableStr(str) == false)
				{
					if (MsgBox(hWnd, MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON2, _UU("NM_PUSH_ROUTE_WARNING")) == IDCANCEL)
					{
						ok = false;
					}
				}
				if (ok)
				{
					if (IsEmptyStr(str) == false)
					{
						if (GetCapsBool(r->p->CapsList, "b_suppport_push_route") == false)
						{
							MsgBox(hWnd, MB_ICONEXCLAMATION, _UU("ERR_147"));
						}
					}
					StrCpy(r->CurrentPushRouteStr, sizeof(r->CurrentPushRouteStr), str);
					EndDialog(hWnd, 1);
				}
				Free(str);
			}
			break;
		case IDCANCEL:
			Close(hWnd);
			break;
		}
		break;
	case WM_CLOSE:
		EndDialog(hWnd, 0);
		break;
	}
	return 0;
}
UINT NmEditPushRouteProc ( HWND hWnd , UINT msg , WPARAM wParam , LPARAM lParam , void * param ) { SM_HUB * r = ( SM_HUB * ) param ; char * str = NULL ; if ( hWnd == NULL ) { return 0 ; } switch ( msg ) { case WM_INITDIALOG : SetTextA ( hWnd , E_TEXT , r -> CurrentPushRouteStr ) ; Focus ( hWnd , E_TEXT ) ; SetIcon ( hWnd , 0 , ICO_PROTOCOL ) ; break ; case WM_COMMAND : switch ( wParam ) { case IDOK : str = GetTextA ( hWnd , E_TEXT ) ; if ( str != NULL ) { bool ok = true ; if ( CheckClasslessRouteTableStr ( str ) == false ) { if ( MsgBox ( hWnd , MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON2 , _UU ( " " ) ) == IDCANCEL ) { ok = false ; } } if ( ok ) { if ( IsEmptyStr ( str ) == false ) { if ( GetCapsBool ( r -> p -> CapsList , " " ) == false ) { MsgBox ( hWnd , MB_ICONEXCLAMATION , _UU ( " " ) ) ; } } StrCpy ( r -> CurrentPushRouteStr , sizeof ( r -> CurrentPushRouteStr ) , str ) ; EndDialog ( hWnd , 1 ) ; } Free ( str ) ; } break ; case IDCANCEL : Close ( hWnd ) ; break ; } break ; case WM_CLOSE : EndDialog ( hWnd , 0 ) ; break ; } return 0 ; }
Dialog proc for the push routing option
Dialog proc for the push routing option
// Validate arguments
