summaryrefslogtreecommitdiffstats
path: root/private/utils/ntbackup/inc/ipx.h
blob: 572fae3567b112e04ef7d19e461e74c57b7ef6c3 (plain) (blame)
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
/** :IH1:   Copyright (C) Maynard Electronics, Inc. 1984-89

    :Name:  IPX.H

    :Description:  Header file for all IPX functions.


	$Log:   G:/LOGFILES/IPX.H_V  $
 * 
 *    Rev 1.0   09 May 1991 13:33:16   HUNTER
 * Initial revision.


$Log$
   
      Rev 2.2   16 Jan 1991 08:53:22   JIMG
   Use ScheduleIPXEvent
   
      Rev 2.1   17 Dec 1990 10:19:30   JIMG
   Fixed spelling error in function name
   
      Rev 2.0   21 May 1990 14:02:22   PAT
   Baseline Maynstream 3.1

   Initial revision.
**/

#ifndef IPX
#define IPX

#pragma pack(1)  /* force byte allignment */

typedef struct IPX_NETWORK { UINT8 digits[4]; } IPX_NETWORK;
typedef struct IPX_NODE { UINT8 digits[6]; } IPX_NODE;
typedef struct IPX_SOCKET { UINT8 digits[2]; } IPX_SOCKET;

typedef IPX_NETWORK far *IPX_NETWORK_PTR;

typedef struct IPXAddress
{
     IPX_NETWORK network; /* high-low */
     IPX_NODE    node;    /* high-low */
     IPX_SOCKET  socket;  /* high-low */
} IPXAddress;

typedef IPXAddress far *IPXAddress_PTR;

typedef struct IPXHeader
{
     UINT16 checkSum;   /* high-low */
     UINT16 length;     /* high-low */
     UINT8 transportControl;
     UINT8 packetType;          /* must initialize for send */
     IPXAddress destination;    /* must initialize for send */
     IPXAddress source;        /* ??? */
} IPXHeader;

typedef IPXHeader far *IPXHeader_PTR;

typedef struct ECBFragment
{
     VOID far *address;
     UINT16 size;  /* low-high */
} ECBFragment;

typedef VOID (far *FAR_PF_VOID)();

typedef struct ECB
{
     VOID far    *linkAddress;
     FAR_PF_VOID ESRAddress;            /* must initialize */
     UINT8       inUseFlag;
     UINT8       completionCode;
     UINT16      socketNumber;       /* high-low, must initialize */
     UINT8       IPXWorkspace[4];
     UINT8       driverWorkspace[12];
     IPX_NODE    immediateAddress; /* high-low, must initialize for send */
     UINT16      fragmentCount;      /* low-high, must initialize */
     ECBFragment fragmentDescriptor[1];   /* must initialize */
} ECB;

typedef ECB far *ECB_PTR;

/*  You must have at least one fragment for the IPXHeader.  If you want   */
/*  to break up the data into more fragments then you must declare an     */
/*  ECB and as many additional fragments as you need in a single          */
/*  structure.                                                            */
/*                                                                        */
/*   Example:   typedef struct ECB3 {                                     */
/*                  ECB ecb;                                              */
/*                  ECBFragment fragmentDescriptor[2];                    */
/*              } ECB3;                                                   */
/*              ECB3 foo;                                                 */
/*   You should refer to the last two fragments as                        */
/*   foo.ecb.fragmentDescriptor[1] and foo.ecb.fragmentDescriptor[2].     */

BOOLEAN  IPXInitialize( VOID );
UINT8    IPXOpenSocket( UINT16 *socketNumber_ptr, UINT16 socketLongevity );
VOID     IPXSendPacket( ECB far *eventControlBlock_ptr );
VOID     IPXListenForPacket( ECB far *eventControlBlock_ptr );
VOID     IPXCloseSocket( UINT16 socketNumber );
UINT8    IPXGetLocalTarget( IPXAddress far *networkAddress_ptr, VOID far *immediateAddress_ptr,
  UINT16 far *transportTime_ptr );
VOID     IPXGetInternetworkAddress( IPXAddress far *networkAddress_ptr );
VOID     IPXScheduleIPXEvent( ECB far *eventControlBlock_ptr, UINT16 delay_time );
UINT8    IPXCancelEvent( ECB far *eventControlBlock_ptr );
UINT16   IPXGetIntervalMarker( VOID );
VOID     IPXRelinquishControl( VOID ) ;
VOID     LogIPXCall( UINT16 CallerID,ECB far *ecb_ptr ) ;

#ifdef MSDEBUG
#define IPXLog(x,y) LogIPXCall(x,y)
#else
#define IPXLog(x,y)
#endif

#define Hi(x) ((UINT8) ((x) >> 8 ))
#define Lo(x) ((UINT8) ((x) & 0x00FF))
#define Int16Swap(x)  ( ( Lo(x) << 8 ) | Hi(x) )

#define IPX_MAX_DATA_SIZE (576 - sizeof( IPXHeader ))


#endif