#include <linux/module.h>
#include <linux/kernel.h>
#include "lwip/api.h"
#include "lwip/sys.h"
#include "rtl_lwipopts.h"
Include dependency graph for udpserver.c:
Go to the source code of this file.
Functions | |
void | udpecho_thread (void *arg) |
int | init_module (void) |
void | cleanup_module (void) |
|
Definition at line 78 of file udpserver.c.
00078 {
00079 printk("\n UDP echo server module removed\n");
00080
00081 }
|
|
Definition at line 71 of file udpserver.c. References NULL, sys_thread_new(), and udpecho_thread().
00071 { 00072 printk("\n\n UDP echo server module inserted\n\n"); 00073 sys_thread_new(udpecho_thread, NULL, 0); 00074 return 0; 00075 } |
Here is the call graph for this function:
|
Definition at line 49 of file udpserver.c. References buffer, conn, ipaddr, netbuf_copy(), netbuf_delete(), netconn_bind(), netconn_new(), netconn_recv(), NETCONN_UDP, and string2ip_addr(). Referenced by init_module().
00050 { 00051 static struct netconn *conn; 00052 static struct netbuf *buf; 00053 char buffer[4096]; 00054 struct ip_addr ipaddr; 00055 00056 string2ip_addr(&ipaddr,RT3COM905C_IP, sizeof(RT3COM905C_IP)); 00057 00058 conn = netconn_new(NETCONN_UDP); 00059 00060 netconn_bind(conn, &ipaddr, 8); 00061 00062 while(1) { 00063 buf = netconn_recv(conn); 00064 netbuf_copy(buf, buffer, sizeof(buffer)); 00065 rtl_printf("------------------- UDP echo server got: %s -----------------\n", buffer); 00066 netbuf_delete(buf); 00067 } 00068 } |
Here is the call graph for this function: