1 #ifndef EL__PROTOCOL_PROTOCOL_H
2 #define EL__PROTOCOL_PROTOCOL_H
4 #include "main/module.h"
30 /* Keep these last! */
35 /* For protocol backend index checking */
39 /* Besides the session an external handler also takes the url as an argument */
40 typedef void (protocol_handler_T
)(struct connection
*);
41 typedef void (protocol_external_handler_T
)(struct session
*, struct uri
*);
43 /* Accessors for the protocol backends. */
45 int get_protocol_port(enum protocol protocol
);
46 int get_protocol_need_slashes(enum protocol protocol
);
47 int get_protocol_keep_double_slashes(enum protocol protocol
);
48 int get_protocol_need_slash_after_host(enum protocol protocol
);
49 int get_protocol_free_syntax(enum protocol protocol
);
50 int get_protocol_need_ssl(enum protocol protocol
);
52 protocol_handler_T
*get_protocol_handler(enum protocol protocol
);
53 protocol_external_handler_T
*get_protocol_external_handler(struct terminal
*, struct uri
*);
55 /* Resolves the given protocol @name with length @namelen to a known protocol,
56 * PROTOCOL_UNKOWN or PROTOCOL_INVALID if no protocol part could be identified.
57 * User defined protocols (configurable via protocol.user) takes precedence. */
58 enum protocol
get_protocol(unsigned char *name
, int namelen
);
60 extern struct module protocol_module
;