david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/include/gpxe/hello.h
Michael Brown 7e61f38799 Moved "hello world" protocol implementation out of prototester.c and into
the first standalong uIP-based protocol module.
2006-03-23 22:37:05 +00:00

47 lines
852 B
C

#ifndef _HELLO_H
#define _HELLO_H
/** @file
*
* "Hello world" TCP protocol
*
*/
#include <stdint.h>
#include <gpxe/tcp.h>
enum hello_state {
HELLO_SENDING_MESSAGE = 1,
HELLO_SENDING_ENDL,
};
/**
* A "hello world" request
*
*/
struct hello_request {
/** TCP connection for this request */
struct tcp_connection tcp;
/** Current state */
enum hello_state state;
/** Message to be transmitted */
const char *message;
/** Amount of message remaining to be transmitted */
size_t remaining;
/** Callback function
*
* @v data Received data
* @v len Length of received data
*
* This function is called for all data received from the
* remote server.
*/
void ( *callback ) ( char *data, size_t len );
/** Connection complete indicator */
int complete;
};
extern int hello_connect ( struct hello_request *hello );
#endif