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