home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / winprogs / ws_ping / ws_ping.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-03  |  3.0 KB  |  92 lines

  1. /***************************************************************************
  2.   Windows Sockets PING Client Application Header File
  3.  
  4.   Written by:
  5.       John A. Junod             Internet: <junodj@gordon-emh2.army.mil>
  6.       267 Hillwood Street                 <zj8549@trotter.usma.edu>
  7.       Martinez, GA 30907      Compuserve: 72321,366 
  8.  
  9.   This program executable and all source code is released into the public
  10.   domain.  It would be nice (but is not required) to give me a little 
  11.   credit for any use of this code.  The primary purpose of this application 
  12.   was to learn what it takes to write a Windows Sockets Application.
  13.  
  14. *****************************************************************************/
  15. /*
  16.   MODULE: WS_FTP.H   (main program header file)
  17. */
  18.  
  19. #include <stdio.h>
  20. #include <string.h>
  21. #include <dir.h>
  22.  
  23. // **** Dialog box names
  24. // #define DLG_ABOUT                 510
  25. // #define DLG_HOST                  520
  26. // #define DLG_INPUT                 530
  27. // #define DLG_STATUS                540
  28.  
  29. // **** menu definitions
  30. // may be used by other functions!
  31.  
  32. #define IDM_CONNECT                 1010
  33. #define IDM_CLOSE                   1020
  34. #define IDM_ASYNC_CONNECT           1030
  35. #define IDM_ABOUT                   1500
  36. #define IDM_EXIT                    1600
  37.  
  38. #define WM_PING_HOST           WM_USER+1
  39. #define WM_PING_PROTO          WM_USER+2
  40. #define WM_PING_CAS            WM_USER+3
  41. #define WM_PING_RECEIVE        WM_USER+4
  42. #define WM_PING_FINISH         WM_USER+5
  43.  
  44. // **** main window child window identifiers
  45. // TXT = static text windows
  46. // LST = list boxes
  47. // BTN = push buttons
  48. // RB  = radio buttons
  49.  
  50. // input dialog controls
  51. #define DLG_PROMPT                  3010
  52. #define DLG_EDIT                    3020
  53.  
  54. // **** connect dialog box controls
  55. #define DLG_HOST_NAME               4010
  56. #define DLG_HOST_NUMPKTS            4020
  57. #define DLG_HOST_PKTLENGTH          4030
  58. #define DLG_HOST_TIMEOUT            4040
  59. #define DLG_HOST_VERBOSE            4050
  60.  
  61. // **** function prototypes
  62.  
  63. // in ws_error.c
  64. LPSTR ReturnWSError(UINT Err,LPSTR szBuf);
  65. void ReportWSError(UINT Err);
  66.  
  67. // in ws_ping.c
  68. LONG FAR PASCAL WndProc(HWND, WORD, WORD, LONG);
  69. BOOL FAR PASCAL WS_AboutMsgProc(HWND, WORD, WORD, LONG);
  70. BOOL FAR PASCAL WS_InputMsgProc(HWND, WORD, WORD, LONG);
  71. BOOL FAR PASCAL WS_HostMsgProc(HWND, WORD, WORD, LONG);
  72. int nCwRegisterClasses(void);
  73. void cwCenter(HWND, int);
  74. void CwUnRegisterClasses(void);
  75.  
  76. // in ws_paint.c
  77. void ReleaseDisplayMem(VOID);
  78. void DoAddLine(LPSTR);
  79. void DoPrintf(char *fmt,...);
  80. void DoPaint(HWND);
  81. int GetLocalInfo(void);
  82.  
  83. // ws_pingr.c
  84. LPSTR ReturnICMPType(int );
  85. int   PrintPkt(LPSTR ,int ,struct sockaddr_in FAR *,BOOL);
  86. int   in_cksum(u_short FAR *,int );
  87. SOCKET create_socket(struct sockaddr_in FAR *,LPSTR s);
  88. int   send_ping(SOCKET , struct sockaddr_in FAR *, LPSTR ,int );
  89. int   recv_ping(SOCKET ,LPSTR ,BOOL );
  90. int   PingHost(LPSTR ,int, int, int, BOOL);
  91. SOCKET DoClose(SOCKET);
  92.