00001
00002
00003
00004
00005
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009
00010 #ifndef PACKETS_OPERATIONS_HEADER
00011 #define PACKETS_OPERATIONS_HEADER
00012
00013 #include <stdio.h>
00014 #include <string.h>
00015 #include <sys/socket.h>
00016 #include <netinet/in.h>
00017 #include <arpa/inet.h>
00018 #include <errno.h>
00019
00020 #include "tables.h"
00021 #include "packets.h"
00022 #include "logging.h"
00023
00024
00025
00026
00027 #define DYNAMIC_IP 0
00028
00029
00030
00031
00032 #define STATIC_IP 1
00033
00034
00035 int packets_send_offer (
00036 struct dhcp_packet *p,
00037 struct mysql_tables *mysql_tables,
00038 char *ip,
00039 unsigned long int broadcast,
00040 unsigned long int server_ip,
00041 int socket_desc,
00042 struct sockaddr_in *client_address,
00043 int tip);
00044
00045 int packets_send_ack (
00046 struct dhcp_packet *p,
00047 struct mysql_tables *mysql_tables,
00048 char *ip,
00049 unsigned long int broadcast,
00050 unsigned long int server_ip,
00051 int socket_desc,
00052 struct sockaddr_in *client_address,
00053 int tip);
00054
00055 int packets_send_nack (
00056 struct dhcp_packet *p,
00057 struct mysql_tables *mysql_tables,
00058 char *ip,
00059 unsigned long int broadcast,
00060 unsigned long int server_ip,
00061 int socket_desc,
00062 struct sockaddr_in *client_address);
00063
00064 int packets_send_dummy_nak (
00065 struct dhcp_packet *p,
00066 struct mysql_tables *mysql_tables,
00067 char *ip,
00068 unsigned long int broadcast,
00069 unsigned long int server_ip,
00070 int socket_desc,
00071 struct sockaddr_in *client_address);
00072
00073 int reply_to_inform (
00074 struct dhcp_packet *p,
00075 struct mysql_tables *mysql_tables,
00076 unsigned long int broadcast,
00077 unsigned long int server_ip,
00078 int socket_desc,
00079 struct sockaddr_in *client_address);
00080
00081 int log_profile (const char *file, const char *mes, const struct opt *profile);
00082
00083 #endif
00084
00085 #ifdef __cplusplus
00086 }
00087 #endif