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