mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 09:32:33 +03:00
names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
34 lines
896 B
C
34 lines
896 B
C
#ifndef PROTO_H
|
|
#define PROTO_H
|
|
|
|
#include <gpxe/tables.h>
|
|
#include "buffer.h"
|
|
#include <gpxe/in.h>
|
|
|
|
struct protocol {
|
|
char *name;
|
|
uint16_t default_port;
|
|
int ( * load ) ( char *url, struct sockaddr_in *server, char *file,
|
|
struct buffer *buffer );
|
|
};
|
|
|
|
/*
|
|
* 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 ( struct protocol, protocol )
|
|
#define __protocol __table ( struct protocol, protocol, 01 )
|
|
#define __default_protocol_start __table ( struct protocol, protocol, 02 )
|
|
#define __default_protocol __table ( struct protocol, protocol, 03 )
|
|
#define __protocol_end __table_end ( struct protocol, protocol )
|
|
|
|
/*
|
|
* Functions in proto.c
|
|
*
|
|
*/
|
|
extern struct protocol * identify_protocol ( const char *name );
|
|
|
|
#endif /* PROTO_H */
|