2005-04-29 13:17:25 +00:00
|
|
|
#ifndef PROTO_H
|
|
|
|
#define PROTO_H
|
|
|
|
|
|
|
|
#include "tables.h"
|
2005-05-09 14:27:29 +00:00
|
|
|
#include "buffer.h"
|
2005-05-01 23:57:09 +00:00
|
|
|
#include "in.h"
|
2005-04-29 13:17:25 +00:00
|
|
|
|
|
|
|
struct protocol {
|
|
|
|
char *name;
|
2005-05-01 23:57:09 +00:00
|
|
|
in_port_t default_port;
|
2005-05-09 14:27:29 +00:00
|
|
|
int ( * load ) ( char *url, struct sockaddr_in *server, char *file,
|
|
|
|
struct buffer *buffer );
|
2005-04-29 13:17:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Protocols that should be used if no explicit protocol is specified
|
|
|
|
* (i.e. tftp) should use __default_protocol; all other protocols
|
|
|
|
* should use __protocol.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define __protocol_start __table_start(protocol)
|
|
|
|
#define __protocol __table(protocol,01)
|
|
|
|
#define __default_protocol_start __table(protocol,02)
|
|
|
|
#define __default_protocol __table(protocol,03)
|
|
|
|
#define __protocol_end __table_end(protocol)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Functions in proto.c
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
extern struct protocol * identify_protocol ( const char *name );
|
|
|
|
|
|
|
|
#endif /* PROTO_H */
|