AFPBridge/afpurlparser.h
Stephen Heumann 73399e8eda Add initial code for AFP Mounter CDev.
This code tries to call EasyMount using the request procedure documented in its ERS, but it turns out that doesn't work. The request procedure trashes its return address on the stack, so it crashes whenever you call it.
2017-04-11 17:34:00 -05:00

40 lines
1.0 KiB
C

#ifndef AFPURLPARSER_H
#define AFPURLPARSER_H
enum protocol { proto_unknown, proto_AT, proto_TCP, proto_invalid };
typedef struct AFPURLParts {
enum protocol protocol;
char *server;
char *zone; /* for AppleTalk only */
char *username;
char *password;
char *auth;
char *volpass;
char *volume;
} AFPURLParts;
/* Maximum lengths of components (for use in our mounter, using EasyMount) */
#define SERVER_MAX 32
#define ZONE_MAX 32
#define USERNAME_MAX 31
#define PASSWORD_MAX 8
#define VOLPASS_MAX 8
#define VOLUME_MAX 27
#define protoInvalidError 4000
#define noServerOrVolumeNameError 4001
#define serverNameTooLongError 4002
#define volumeNameTooLongError 4003
#define zoneTooLongError 4004
#define usernameTooLongError 4005
#define passwordTooLongError 4006
#define volpassTooLongError 4007
#define userXorPasswordError 4008
#define badUAMError 4009
AFPURLParts parseAFPURL(char *url);
int validateAFPURL(AFPURLParts *urlParts);
#endif