4 cdef extern from "errno.h":
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 void * memcpy(void *s1, void *s2, size_t n)
12 size_t strlen(char *s)
14 cdef extern from "stdlib.h":
15 void * malloc(size_t size)
18 cdef extern from "netinet/in.h":
23 unsigned short sin_port
27 cdef extern from "afs/stds.h":
28 ctypedef unsigned long afs_uint32
29 ctypedef long afs_int32
31 cdef extern from "afs/dirpath.h":
32 char * AFSDIR_CLIENT_ETC_DIRPATH
34 cdef extern from "afs/cellconfig.h":
40 # We just pass afsconf_dir structs around to other AFS functions,
41 # so this can be treated as opaque
45 # For afsconf_cell, on the other hand, we care about everything
47 char name[MAXCELLCHARS]
50 sockaddr_in hostAddr[MAXHOSTSPERCELL]
51 char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS]
55 afsconf_dir *afsconf_Open(char *adir)
56 int afsconf_GetCellInfo(afsconf_dir *adir,
59 afsconf_cell *acellInfo)
61 cdef extern from "rx/rxkad.h":
62 ctypedef char rxkad_level
72 struct ktc_encryptionKey:
76 char name[MAXKTCNAMELEN]
77 char instance[MAXKTCNAMELEN]
78 char cell[MAXKTCREALMLEN]
80 struct rx_securityClass:
83 rx_securityClass *rxkad_NewClientSecurityObject(rxkad_level level,
84 ktc_encryptionKey *sessionKey,
88 rx_securityClass *rxnull_NewClientSecurityObject()
90 int rxs_Release(rx_securityClass *aobj)
92 cdef extern from "rx/rx.h":
99 rx_connection *rx_NewConnection(afs_uint32 shost,
100 unsigned short sport,
101 unsigned short sservice,
102 rx_securityClass *securityObject,
103 int serviceSecurityIndex)
105 cdef extern from "afs/auth.h":
110 ktc_encryptionKey sessionKey
113 char ticket[MAXKTCTICKETLEN]
115 int ktc_GetToken(ktc_principal *server,
118 ktc_principal *client)
120 cdef extern from "afs/prclient.h":
124 cdef extern from "ubik.h":
128 # ubik_client is an opaque struct, so we don't care about its members
132 int ubik_ClientInit(rx_connection **serverconns,
133 ubik_client **aclient)
134 afs_int32 ubik_ClientDestroy(ubik_client *aclient)
136 cdef extern from "afs/com_err.h":
137 char * afs_error_message(int)
139 # All AFS error tables
140 cdef extern from "afs/auth.h":
141 void initialize_KTC_error_table()
142 cdef extern from "afs/cellconfig.h":
143 void initialize_ACFG_error_table()
144 cdef extern from "afs/pterror.h":
145 void initialize_PT_error_table()
146 cdef extern from "rx/rxkad.h":
147 void initialize_RXK_error_table()
148 cdef extern from "ubik.h":
149 void initialize_U_error_table()
151 cdef extern from "afs/vice.h":
155 unsigned short out_size
156 unsigned short in_size
158 cdef import from "afs/venus.h":
160 # PIOCTLS to Venus that we use
161 VIOCGETAL, VIOC_GETVCXSTATUS2, VIOCSETAL
163 # pioctl doesn't actually have a header, so we have to define it here
164 cdef extern int pioctl(char *, afs_int32, ViceIoctl *, afs_int32)
165 cdef int pioctl_read(char *, afs_int32, void *, unsigned short, afs_int32) except -1
166 cdef int pioctl_write(char *, afs_int32, char *, afs_int32) except -1