Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

sockets.h

Go to the documentation of this file.
00001 /*! \file sockets.h
00002     Header file for socket management module (sockets.c).
00003  */
00004 
00005 #ifdef __cplusplus
00006 extern "C" {
00007 #endif
00008 
00009 
00010 #ifndef SOCKETS_H
00011 #define SOCKETS_H
00012 
00013 #include <stdio.h>
00014 #include <errno.h>
00015 #include <stdarg.h>
00016 #include <string.h>
00017 #include <stdlib.h>
00018 
00019 #include <sys/types.h>
00020 #include <netinet/in.h>
00021 #include <netdb.h>
00022 #include <sys/param.h>
00023 #include <netdb.h>
00024 #include <sys/socket.h>
00025 #include <arpa/inet.h>
00026 #include <linux/if.h>
00027 #include <linux/sockios.h>
00028 #include <sys/ioctl.h>
00029 
00030 /*! \brief Maximum number of characters for an IP address (XXX.XXX.XXX.XXX), including the terminal zero.
00031  */ 
00032 
00033 #define MAX_IP_ADDRESS_STR_SIZE   16
00034 
00035 int create_socket (
00036                      int port,
00037                      struct sockaddr_in *add,
00038                      char *host,
00039                      char *interface,
00040                      int len,
00041                      unsigned long int *broadcast,
00042                      unsigned long int *netmask,
00043                      unsigned long int *myip,
00044                      int (*syslog)(const char *file, const char * fmt,...),
00045                      char *log
00046                   );
00047 
00048 char *get_last_socket_error();
00049 void get_remote_address (struct sockaddr_in *sender, char *ip, int *port);
00050 
00051 #endif
00052 
00053 #ifdef __cplusplus
00054 }
00055 #endif

Generated on Mon Jun 19 12:31:06 2006 for MyDhcp_V2 by doxygen1.2.15