Back to index

nagios-plugins  1.4.16
Defines | Functions
sockets.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SOCKETS_1_0   0x100 /* don't use - does not work on Windows XP */
#define SOCKETS_1_1   0x101
#define SOCKETS_2_0   0x200 /* don't use - does not work on Windows XP */
#define SOCKETS_2_1   0x201
#define SOCKETS_2_2   0x202
#define gl_fd_to_handle(x)   (x)

Functions

int gl_sockets_startup (int version)
int gl_sockets_cleanup (void)

Define Documentation

#define gl_fd_to_handle (   x)    (x)

Definition at line 47 of file sockets.h.

#define SOCKETS_1_0   0x100 /* don't use - does not work on Windows XP */

Definition at line 23 of file sockets.h.

#define SOCKETS_1_1   0x101

Definition at line 24 of file sockets.h.

#define SOCKETS_2_0   0x200 /* don't use - does not work on Windows XP */

Definition at line 25 of file sockets.h.

#define SOCKETS_2_1   0x201

Definition at line 26 of file sockets.h.

#define SOCKETS_2_2   0x202

Definition at line 27 of file sockets.h.


Function Documentation

int gl_sockets_cleanup ( void  )

Definition at line 103 of file sockets.c.

{
#if WINDOWS_SOCKETS
  int err;

  initialized_sockets_version = 0;

  unregister_close_hook (&close_sockets_hook);

  err = WSACleanup ();
  if (err != 0)
    return 1;
#endif

  return 0;
}
int gl_sockets_startup ( int  version)

Definition at line 77 of file sockets.c.

{
#if WINDOWS_SOCKETS
  if (version > initialized_sockets_version)
    {
      WSADATA data;
      int err;

      err = WSAStartup (version, &data);
      if (err != 0)
        return 1;

      if (data.wVersion < version)
        return 2;

      if (initialized_sockets_version == 0)
        register_close_hook (close_fd_maybe_socket, &close_sockets_hook);

      initialized_sockets_version = version;
    }
#endif

  return 0;
}

Here is the call graph for this function: