rx: Remove RX_CALL_BUSY
[openafs.git] / src / WINNT / client_osi / osifd.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /* Copyright (C) 1994 Cazamar Systems, Inc. */
11
12 #ifndef OPENAFS_WINNT_CLIENT_OSI_OSIFD_H
13 #define OPENAFS_WINNT_CLIENT_OSI_OSIFD_H 1
14
15 #include "dbrpc.h"
16 #include "osiqueue.h"
17
18 struct osi_fd;
19 struct osi_fdType;
20
21 /* operations on a file descriptor */
22 typedef struct osi_fdOps {
23         /* create an object, passed in the type info and returns
24          * the newly created fd.  This is the only function not passed
25          * in the object, since it creates it.
26          */
27         long (*Create)(struct osi_fdType *, struct osi_fd **);
28
29         /* gets info about the object; fields are type specific, and eventually
30          * self-labelling
31          */
32         long (*GetInfo)(struct osi_fd *, osi_remGetInfoParms_t *);
33
34         /* close an object; frees the storage associated with it */
35         long (*Close)(struct osi_fd *);
36 } osi_fdOps_t;
37
38 /* header structure that must be at the start of all FDs so that we can find
39  * them generically from the network layer by fd number.
40  */
41 typedef struct osi_fd {
42         osi_queue_t q;
43         osi_fdOps_t *opsp;
44         long fd;
45 } osi_fd_t;
46
47 /* represents a specific file descriptor for iterating over all file
48  * descriptor types.
49  */
50 typedef struct osi_typeFD {
51         osi_fd_t fd;                    /* header */
52         struct osi_fdType *curp;        /* type scan is about to return next */
53 } osi_typeFD_t;
54
55 typedef struct osi_fdTypeFormat {
56         struct osi_fdTypeFormat *nextp;
57         char *labelp;
58         long region;
59         long index;
60         long format;
61 } osi_fdTypeFormat_t;
62
63 /* describes type of file descriptor; anyone can register a new one */
64 typedef struct osi_fdType {
65         osi_queue_t q;          /* for threading together so we can find by name */
66         char *namep;            /* name */
67         void *rockp;            /* opaque for type owner */
68         osi_fdOps_t *opsp;      /* operations */
69         osi_fdTypeFormat_t *formatListp;        /* list of formatting info */
70 } osi_fdType_t;
71
72 extern osi_fdType_t *osi_FindFDType(char *);
73
74 extern osi_fdType_t *osi_RegisterFDType(char *, osi_fdOps_t *, void *);
75
76 extern long osi_UnregisterFDType(char *);
77
78 extern int osi_AddFDFormatInfo(osi_fdType_t *typep, long region, long index,
79         char *labelp, long format);
80
81 extern int osi_InitFD(void);
82
83 extern osi_fd_t *osi_AllocFD(char *);
84
85 extern osi_fd_t *osi_FindFD(long);
86
87 extern int osi_CloseFD(osi_fd_t *);
88
89 extern long osi_FDTypeCreate(osi_fdType_t *, osi_fd_t **);
90
91 extern long osi_FDTypeGetInfo(osi_fd_t *, osi_remGetInfoParms_t *);
92
93 extern long osi_FDTypeClose(osi_fd_t *);
94
95 #endif /* OPENAFS_WINNT_CLIENT_OSI_OSIFD_H */
96