6 #include <gpxe/async.h>
7 #include <gpxe/hello.h>
9 static void test_hello_callback ( char *data, size_t len ) {
13 for ( i = 0 ; i < len ; i++ ) {
17 } else if ( ( c == '\n' ) || ( c >= 32 ) || ( c <= 126 ) ) {
25 void test_hello ( struct sockaddr_tcpip *server, const char *message ) {
26 /* Quick and dirty hack */
27 struct sockaddr_in *sin = ( struct sockaddr_in * ) server;
28 struct hello_request hello;
31 printf ( "Saying \"%s\" to %s:%d\n", message,
32 inet_ntoa ( sin->sin_addr ), ntohs ( sin->sin_port ) );
34 memset ( &hello, 0, sizeof ( hello ) );
35 memcpy ( &hello.tcp.peer, server, sizeof ( hello.tcp.peer ) );
36 hello.message = message;
37 hello.callback = test_hello_callback;
39 rc = async_wait ( say_hello ( &hello ) );
41 printf ( "HELLO fetch failed\n" );