wscontrol.h 4.6 KB
Newer Older
1 2 3 4 5 6 7 8
/* wscontrol.h
 *
 * This header file includes #defines, structure and type definitions,
 * and function declarations that support the implementation of the
 * (undocumented) Winsock 1 call WsControl.
 *
 * The functionality of WsControl was created by observing its behaviour
 * in Windows 98, so there are likely to be bugs with the assumptions
9 10 11
 * that were made.  A significant amount of help came from
 * http://tangentsoft.net/wskfaq/articles/wscontrol.html , especially the
 * trace by Thomas Divine (www.pcausa.net).
12 13
 *
 * Copyright 2000 James Hatheway
14
 * Copyright 2003 Juan Lang
15 16 17 18 19 20 21 22 23 24 25 26 27
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
28
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 30 31 32 33
 */

#ifndef WSCONTROL_H_INCLUDED
#define WSCONTROL_H_INCLUDED

34
#define WSCTL_SUCCESS        0
35 36 37 38 39 40 41 42 43 44 45

/*
 *      TCP/IP action codes.
 */
#define WSCNTL_TCPIP_QUERY_INFO             0x00000000
#define WSCNTL_TCPIP_SET_INFO               0x00000001
#define WSCNTL_TCPIP_ICMP_ECHO              0x00000002
#define WSCNTL_TCPIP_TEST                   0x00000003


/* Structure of an entity ID */
46
typedef struct TDIEntityID
47
{
James Hatheway's avatar
James Hatheway committed
48 49
   unsigned long tei_entity;
   unsigned long tei_instance;
50 51 52
} TDIEntityID;

/* Structure of an object ID */
53
typedef struct TDIObjectID
54
{
James Hatheway's avatar
James Hatheway committed
55 56 57 58
   TDIEntityID   toi_entity;
   unsigned long toi_class;
   unsigned long toi_type;
   unsigned long toi_id;
59 60
} TDIObjectID;

61
/* FIXME: real name and definition of this struct that contains
62 63 64
 * an IP route table entry is unknown */
typedef struct IPRouteEntry {
   unsigned long ire_addr;
65
   unsigned long ire_index;  /*matches interface index used by iphlpapi */
66 67 68 69 70 71 72 73 74 75 76 77 78
   unsigned long ire_metric;
   unsigned long ire_option4;
   unsigned long ire_option5;
   unsigned long ire_option6;
   unsigned long ire_gw;
   unsigned long ire_option8;
   unsigned long ire_option9;
   unsigned long ire_option10;
   unsigned long ire_mask;
   unsigned long ire_option12;
} IPRouteEntry;


79 80 81
/* Constants for use in the toi_id field */
#define ENTITY_LIST_ID 0 /* to get the list of entity IDs */
#define ENTITY_TYPE_ID 1 /* it's an interface; what type of interface is it? */
82
#define IP_MIB_TABLE_ENTRY_ID 0x101 /* not real name */
83
#define IP_MIB_ADDRTABLE_ENTRY_ID  0x102
84

85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
/* Constants for use in the toi_class field */
#define INFO_CLASS_GENERIC  0x100
#define INFO_CLASS_PROTOCOL 0x200

/* Constants for use in the toi_type field */
#define INFO_TYPE_PROVIDER 0x100

/* Interface types.  The first one can be returned in the entity ID list--it's
 * an interface, and it can be further queried for what type of interface it is.
 */
#define IF_GENERIC 0x200 /* generic interface */
#define IF_MIB     0x202 /* supports MIB-2 interface */

/* address translation types.  The first can be turned in the entity ID list--
 * it supports address translation of some type, and it can be further queried
 * for what type of address translation it supports (I think).
 */
#define AT_ENTITY 0x280
#define AT_ARP    0x280
#define AT_NULL   0x282 /* doesn't do address translation after all (liar) */

/* network layer service providers.  The first one can be returned in the
 * entity list ID--it supports a network layer (datagram) service, and it can
 * be further queried for what type of network layer service it provides.
 */
#define CL_NL_ENTITY 0x301
#define CL_NL_IPX    0x301 /* implements IPX--probably won't see this, since
                            * we're querying the TCP protocol */
#define CL_NL_IP     0x303 /* implements IP */

/* echo request/response types.  The first can be returned in the entity ID
 * list--it can be further queried for what type of echo it supports (I think).
 */
#define ER_ENTITY 0x380
#define ER_ICMP   0x380

/* connection-oriented transport layer protocols--you know the drill by now */
#define CO_TL_ENTITY 0x400
#define CO_TL_NBF    0x400
#define CO_TL_SPX    0x402
#define CO_TL_TCP    0x404
#define CO_TL_SPP    0x406

/* connectionless transport layer protocols--you know the drill by now */
#define CL_TL_ENTITY 0x401
#define CL_TL_NBF    0x401
#define CL_TL_UDP    0x403
132 133

#endif /* WSCONTROL_H_INCLUDED */