This file is indexed.

/usr/include/ptlib/ipxsock.h is in libpt-1.10.10-dev 1.10.10-3.1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
/*
 * ipxsock.h
 *
 * IPX protocol socket I/O channel class.
 *
 * Portable Windows Library
 *
 * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 * the License for the specific language governing rights and limitations
 * under the License.
 *
 * The Original Code is Portable Windows Library.
 *
 * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
 *
 * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
 * All Rights Reserved.
 *
 * Contributor(s): ______________________________________.
 *
 * $Log: ipxsock.h,v $
 * Revision 1.12  2005/11/25 03:43:47  csoutheren
 * Fixed function argument comments to be compatible with Doxygen
 *
 * Revision 1.11  2003/09/17 05:41:58  csoutheren
 * Removed recursive includes
 *
 * Revision 1.10  2003/09/17 01:18:02  csoutheren
 * Removed recursive include file system and removed all references
 * to deprecated coooperative threading support
 *
 * Revision 1.9  2002/09/16 01:08:59  robertj
 * Added #define so can select if #pragma interface/implementation is used on
 *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
 *
 * Revision 1.8  2001/05/22 12:49:32  robertj
 * Did some seriously wierd rewrite of platform headers to eliminate the
 *   stupid GNU compiler warning about braces not matching.
 *
 * Revision 1.7  1999/03/09 02:59:50  robertj
 * Changed comments to doc++ compatible documentation.
 *
 * Revision 1.6  1999/02/16 08:12:00  robertj
 * MSVC 6.0 compatibility changes.
 *
 * Revision 1.5  1998/11/30 02:50:58  robertj
 * New directory structure
 *
 * Revision 1.4  1998/09/23 06:20:47  robertj
 * Added open source copyright license.
 *
 * Revision 1.3  1996/10/08 13:21:04  robertj
 * More IPX implementation.
 *
 * Revision 1.1  1996/09/14 13:00:56  robertj
 * Initial revision
 *
 */

#ifndef _PIPXSOCKET
#define _PIPXSOCKET

#ifdef P_USE_PRAGMA
#pragma interface
#endif

#include <ptlib/socket.h>


/**This class describes a type of socket that will communicate using the
   IPX/SPX protocols.
 */
class PIPXSocket : public PSocket
{
  PCLASSINFO(PIPXSocket, PSocket);

  public:
    /**Create a new IPX datagram socket.
     */
    PIPXSocket(
      WORD port = 0       ///< Port number to use for the connection.
    );


  public:
    /** IPX protocol address specification.
     */
    class Address {
      public:
        union {
          struct {
            BYTE b1,b2,b3,b4;
          } b;
          struct {
            WORD w1,s_w2;
          } w;
          DWORD dw;
        } network;
        BYTE node[6];

        /** Create new, invalid, address. */
        Address();
        /** Create copy of existing address */
        Address(const Address & addr /** Address to copy */);
        /** Create address from string representation. */
        Address(const PString & str /** String representation of address */);
        /** Create address from node and net numbers. */
        Address(
          DWORD netNum, ///< IPX network number.
          const char * nodeNum  ///< IPX node number (MAC address)
        );
        /** Create copy of existing address */
        Address & operator=(const Address & addr /** Address to copy */);
        /** Get string representation of IPX address */
        operator PString() const;
        /** Determine if address is valid. Note that this does not mean that
            the host is online.
            @return TRUE is address is valid.
          */
        BOOL IsValid() const;
      /** Output string representation of IPX address to stream. */
      friend ostream & operator<<(
        ostream & strm, ///< Stream to output to
        Address & addr  ///< Address to output
      ) { return strm << (PString)addr; }
    };

  /**@name Overrides from class PChannel */
  //@{
    /**Get the platform and I/O channel type name of the channel. For an
       IPX/SPX socket this returns the network number, node number of the
       peer the socket is connected to, followed by the socket number it
       is connected to.

       @return
       the name of the channel.
     */
    virtual PString GetName() const;
  //@}


  /**@name Overrides from class PSocket */
  //@{
    /**Connect a socket to a remote host on the port number of the socket.
       This is
       typically used by the client or initiator of a communications channel.
       This connects to a "listening" socket at the other end of the
       communications channel.

       The port number as defined by the object instance construction or the
       #PIPSocket::SetPort()# function.

       @return
       TRUE if the channel was successfully connected to the remote host.
     */
    virtual BOOL Connect(
      const PString & address   ///< Address of remote machine to connect to.
    );
    /**Connect a socket to a remote host on the port number of the socket.
       This is
       typically used by the client or initiator of a communications channel.
       This connects to a "listening" socket at the other end of the
       communications channel.

       The port number as defined by the object instance construction or the
       #PIPSocket::SetPort()# function.

       @return
       TRUE if the channel was successfully connected to the remote host.
     */
    virtual BOOL Connect(
      const Address & address   ///< Address of remote machine to connect to.
    );

    /**Listen on a socket for a remote host on the specified port number. This
       may be used for server based applications. A "connecting" socket begins
       a connection by initiating a connection to this socket. An active socket
       of this type is then used to generate other "accepting" sockets which
       establish a two way communications channel with the "connecting" socket.

       If the #port# parameter is zero then the port number as
       defined by the object instance construction or the
       #PIPSocket::SetPort()# function.

       For the UDP protocol, the #queueSize# parameter is ignored.

       @return
       TRUE if the channel was successfully opened.
     */
    virtual BOOL Listen(
      unsigned queueSize = 5,  ///< Number of pending accepts that may be queued.
      WORD port = 0,           ///< Port number to use for the connection.
      Reusability reuse = AddressIsExclusive ///< Can/Cant listen more than once.
    );
  //@}

  /**@name Address and name space look up functions */
  //@{
    /**Get the host name for the host specified server.

       @return
       Name of the host or IPX number of host.
     */
    static PString GetHostName(
      const Address & addr    ///< Hosts IP address to get name for
    );

    /**Get the IPX address for the specified host.

       @return
       TRUE if the IPX number was returned.
     */
    static BOOL GetHostAddress(
      Address & addr    ///< Variable to receive this hosts IP address
    );

    /**Get the IPX address for the specified host.

       @return
       TRUE if the IPX number was returned.
     */
    static BOOL GetHostAddress(
      const PString & hostname,
      /** Name of host to get address for. This may be either a server name or
         an IPX number in "colon" format.
       */
      Address & addr    ///< Variable to receive hosts IPX address
    );

    /**Get the IPX/SPX address for the local host.

       @return
       TRUE if the IPX number was returned.
     */
    BOOL GetLocalAddress(
      Address & addr    ///< Variable to receive hosts IPX address
    );

    /**Get the IPX/SPX address for the local host.

       @return
       TRUE if the IPX number was returned.
     */
    BOOL GetLocalAddress(
      Address & addr,    ///< Variable to receive peer hosts IPX address
      WORD & port        ///< Variable to receive peer hosts port number
    );

    /**Get the IPX/SPX address for the peer host the socket is
       connected to.

       @return
       TRUE if the IPX number was returned.
     */
    BOOL GetPeerAddress(
      Address & addr    ///< Variable to receive hosts IPX address
    );

    /**Get the IPX/SPX address for the peer host the socket is
       connected to.

       @return
       TRUE if the IPX number was returned.
     */
    BOOL GetPeerAddress(
      Address & addr,    ///< Variable to receive peer hosts IPX address
      WORD & port        ///< Variable to receive peer hosts port number
    );
  //@}

  /**@name I/O functions */
  //@{
    /**Sets the packet type for datagrams sent by this socket.

       @return
       TRUE if the type was successfully set.
     */
    BOOL SetPacketType(
      int type    ///< IPX packet type for this socket.
    );

    /**Gets the packet type for datagrams sent by this socket.

       @return
       type of packets or -1 if error.
     */
    int GetPacketType();


    /**Read a datagram from a remote computer.
       
       @return
       TRUE if all the bytes were sucessfully written.
     */
    virtual BOOL ReadFrom(
      void * buf,     ///< Data to be written as URGENT TCP data.
      PINDEX len,     ///< Number of bytes pointed to by #buf#.
      Address & addr, ///< Address from which the datagram was received.
      WORD & port     ///< Port from which the datagram was received.
    );

    /**Write a datagram to a remote computer.

       @return
       TRUE if all the bytes were sucessfully written.
     */
    virtual BOOL WriteTo(
      const void * buf,   ///< Data to be written as URGENT TCP data.
      PINDEX len,         ///< Number of bytes pointed to by #buf#.
      const Address & addr, ///< Address to which the datagram is sent.
      WORD port           ///< Port to which the datagram is sent.
    );
  //@}


  protected:
    virtual BOOL OpenSocket();
    virtual const char * GetProtocolName() const;


// Include platform dependent part of class
#ifdef _WIN32
#include "msos/ptlib/ipxsock.h"
#else
#include "unix/ptlib/ipxsock.h"
#endif
};

#endif

// End Of File ///////////////////////////////////////////////////////////////