Add ListMembers.
[invirt/packages/python-afs.git] / afs / afs.pxd
1 cdef extern from *:
2     ctypedef long size_t
3
4 cdef extern from "errno.h":
5     int errno
6
7 cdef extern from "string.h":
8     char * strerror(int errnum)
9     char * strncpy(char *s1, char *s2, size_t n)
10     void * memset(void *b, int c, size_t n)
11
12 cdef extern from "stdlib.h":
13      void * malloc(int size)
14      void free(void *)
15
16 cdef extern from "netinet/in.h":
17     struct in_addr:
18         int s_addr
19     struct sockaddr_in:
20         short sin_family
21         unsigned short sin_port
22         in_addr sin_addr
23         char sin_zero[8]
24
25 cdef extern from "afs/stds.h":
26     ctypedef unsigned long afs_uint32
27     ctypedef long afs_int32
28
29 cdef extern from "afs/dirpath.h":
30     char * AFSDIR_CLIENT_ETC_DIRPATH
31
32 cdef extern from "afs/cellconfig.h":
33     enum:
34         MAXCELLCHARS
35         MAXHOSTSPERCELL
36         MAXHOSTCHARS
37
38     # We just pass afsconf_dir structs around to other AFS functions,
39     # so this can be treated as opaque
40     struct afsconf_dir:
41         pass
42
43     # For afsconf_cell, on the other hand, we care about everything
44     struct afsconf_cell:
45         char name[MAXCELLCHARS]
46         short numServers
47         short flags
48         sockaddr_in hostAddr[MAXHOSTSPERCELL]
49         char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS]
50         char *linkedCell
51         int timeout
52
53     afsconf_dir *afsconf_Open(char *adir)
54     int afsconf_GetCellInfo(afsconf_dir *adir,
55                             char *acellName,
56                             char *aservice,
57                             afsconf_cell *acellInfo)
58
59 cdef extern from "rx/rxkad.h":
60     ctypedef char rxkad_level
61
62     enum:
63         MAXKTCNAMELEN
64         MAXKTCREALMLEN
65
66     enum:
67         rxkad_clear
68         rxkad_crypt
69
70     struct ktc_encryptionKey:
71         pass
72
73     struct ktc_principal:
74         char name[MAXKTCNAMELEN]
75         char instance[MAXKTCNAMELEN]
76         char cell[MAXKTCREALMLEN]
77
78     struct rx_securityClass:
79         pass
80
81     rx_securityClass *rxkad_NewClientSecurityObject(rxkad_level level,
82                                                     ktc_encryptionKey *sessionKey,
83                                                     afs_int32 kvno,
84                                                     int ticketLen,
85                                                     char *ticket)
86     rx_securityClass *rxnull_NewClientSecurityObject()
87
88     int rxs_Release(rx_securityClass *aobj)
89
90 cdef extern from "rx/rx.h":
91     int rx_Init(int port)
92     void rx_Finalize()
93
94     struct rx_connection:
95         pass
96
97     rx_connection *rx_NewConnection(afs_uint32 shost,
98                                     unsigned short sport,
99                                     unsigned short sservice,
100                                     rx_securityClass *securityObject,
101                                     int serviceSecurityIndex)
102
103 cdef extern from "afs/auth.h":
104     enum:
105         MAXKTCTICKETLEN
106
107     struct ktc_token:
108         ktc_encryptionKey sessionKey
109         short kvno
110         int ticketLen
111         char ticket[MAXKTCTICKETLEN]
112
113     int ktc_GetToken(ktc_principal *server,
114                      ktc_token *token,
115                      int tokenLen,
116                      ktc_principal *client)
117
118 cdef extern from "afs/prclient.h":
119     enum:
120         PRSRV
121
122 cdef extern from "ubik.h":
123     enum:
124         MAXSERVERS
125
126     # ubik_client is an opaque struct, so we don't care about its members
127     struct ubik_client:
128         pass
129
130     int ubik_ClientInit(rx_connection **serverconns,
131                         ubik_client **aclient)
132     afs_int32 ubik_ClientDestroy(ubik_client *aclient)
133
134 cdef extern from "afs/com_err.h":
135     char * afs_error_message(int)