#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include "tables.h"
#include "packets.h"
#include "logging.h"
Go to the source code of this file.
Defines | |
#define | DYNAMIC_IP 0 |
This value defines a dynamic IP address (that should be tacken from the dynamic pool). | |
#define | STATIC_IP 1 |
This value defines a static IP address (that should be tacken from the static pool). | |
Functions | |
int | packets_send_offer (struct dhcp_packet *p, struct mysql_tables *mysql_tables, char *ip, unsigned long int broadcast, unsigned long int server_ip, int socket_desc, struct sockaddr_in *client_address, int tip) |
Send a DHCPOFFER and log the output packet. More... | |
int | packets_send_ack (struct dhcp_packet *p, struct mysql_tables *mysql_tables, char *ip, unsigned long int broadcast, unsigned long int server_ip, int socket_desc, struct sockaddr_in *client_address, int tip) |
Send a DHCPACK in response to a REQUEST and log the output packet. More... | |
int | packets_send_nack (struct dhcp_packet *p, struct mysql_tables *mysql_tables, char *ip, unsigned long int broadcast, unsigned long int server_ip, int socket_desc, struct sockaddr_in *client_address) |
Send a DHCPNAK in response to a REQUEST and log the output packet. More... | |
int | packets_send_dummy_nak (struct dhcp_packet *p, struct mysql_tables *mysql_tables, char *ip, unsigned long int broadcast, unsigned long int server_ip, int socket_desc, struct sockaddr_in *client_address) |
Send a dummy DHCPNAK and log the output packet. More... | |
int | reply_to_inform (struct dhcp_packet *p, struct mysql_tables *mysql_tables, unsigned long int broadcast, unsigned long int server_ip, int socket_desc, struct sockaddr_in *client_address) |
Send a DHCPACK as response to an INFORM. More... | |
int | log_profile (const char *file, const char *mes, const struct opt *profile) |
Log a packet's profile (list of options) in a human readables format. More... |
Definition in file packets_operations.h.
|
Log a packet's profile (list of options) in a human readables format.
Definition at line 719 of file packets_operations.c. References dater(). |
|
Send a DHCPACK in response to a REQUEST and log the output packet.
Definition at line 520 of file packets_operations.c. References mysql_tables::abonne_ip, add_option_to_profile(), BOOTREPLY, global_config::broadcast_mode, context2profile(), global_config::csv_file, dhcp_packet::ctrl, global_config::debug, global_config::debug_file, DHCPACK_HEXA, global_config::dumper_mode, DYNAMIC_IP, table_ip_lease::gateway, table_abonne_ip::gateway, mysql_tables::ip_lease, global_config::log_file, my_syslog(), packet_dump(), packets_clear(), packets_close_option(), packets_get_bin_chaddr(), packets_get_bin_ciaddr(), packets_get_bin_giaddr(), packets_get_flags(), packets_get_hlen(), packets_get_htype(), packets_get_secs(), packets_get_xid(), packets_set_bin_ciaddr(), packets_set_bin_giaddr(), packets_set_chaddr(), packets_set_flags(), packets_set_hlen(), packets_set_hops(), packets_set_htype(), packets_set_op(), packets_set_option(), packets_set_secs(), packets_set_siaddr(), packets_set_xid(), packets_set_yiaddr(), global_config::server_ip_seen_by_client, STATIC_IP, table_ip_lease::subnet, table_abonne_ip::subnet, op_control::taille, and TARGET_PORT. Referenced by find_ip_and_reply(). |
|
Send a dummy DHCPNAK and log the output packet.
Definition at line 1084 of file packets_operations.c. References global_config::log_file, my_syslog(), and packets_send_nack(). Referenced by main(). |
|
Send a DHCPNAK in response to a REQUEST and log the output packet.
Definition at line 921 of file packets_operations.c. References add_option_to_profile(), BOOTREPLY, global_config::broadcast_mode, clear_profile(), global_config::csv_file, dhcp_packet::ctrl, global_config::debug, global_config::debug_file, DHCPNAK_HEXA, global_config::dumper_mode, global_config::log_file, my_syslog(), packet_dump(), packets_clear(), packets_close_option(), packets_get_bin_chaddr(), packets_get_bin_ciaddr(), packets_get_bin_giaddr(), packets_get_flags(), packets_get_hlen(), packets_get_htype(), packets_get_secs(), packets_get_xid(), packets_set_bin_ciaddr(), packets_set_bin_giaddr(), packets_set_chaddr(), packets_set_flags(), packets_set_hlen(), packets_set_hops(), packets_set_htype(), packets_set_op(), packets_set_option(), packets_set_secs(), packets_set_siaddr(), packets_set_xid(), packets_set_yiaddr(), global_config::server_ip_seen_by_client, op_control::taille, and TARGET_PORT. Referenced by find_ip_and_reply(), and packets_send_dummy_nak(). |
|
Send a DHCPOFFER and log the output packet.
Definition at line 309 of file packets_operations.c. References mysql_tables::abonne_ip, add_option_to_profile(), BOOTREPLY, global_config::broadcast_mode, context2profile(), global_config::csv_file, dhcp_packet::ctrl, global_config::debug, global_config::debug_file, DHCPOFFER_HEXA, global_config::dumper_mode, DYNAMIC_IP, table_ip_lease::gateway, table_abonne_ip::gateway, mysql_tables::ip_lease, global_config::log_file, my_syslog(), packet_dump(), packets_clear(), packets_close_option(), packets_get_bin_chaddr(), packets_get_bin_giaddr(), packets_get_flags(), packets_get_hlen(), packets_get_htype(), packets_get_secs(), packets_get_xid(), packets_set_bin_giaddr(), packets_set_chaddr(), packets_set_flags(), packets_set_hlen(), packets_set_hops(), packets_set_htype(), packets_set_op(), packets_set_option(), packets_set_secs(), packets_set_siaddr(), packets_set_xid(), packets_set_yiaddr(), global_config::server_ip_seen_by_client, STATIC_IP, table_ip_lease::subnet, table_abonne_ip::subnet, op_control::taille, and TARGET_PORT. Referenced by find_ip_and_reply(). |
|
Send a DHCPACK as response to an INFORM.
Definition at line 769 of file packets_operations.c. References add_option_to_profile(), BOOTREPLY, global_config::broadcast_mode, context2profile(), global_config::csv_file, dhcp_packet::ctrl, global_config::debug, global_config::debug_file, DHCPACK_HEXA, global_config::dumper_mode, global_config::log_file, my_syslog(), packet_dump(), packets_clear(), packets_close_option(), packets_get_bin_chaddr(), packets_get_bin_ciaddr(), packets_get_bin_giaddr(), packets_get_flags(), packets_get_hlen(), packets_get_htype(), packets_get_secs(), packets_get_xid(), packets_set_bin_ciaddr(), packets_set_bin_giaddr(), packets_set_chaddr(), packets_set_flags(), packets_set_hlen(), packets_set_hops(), packets_set_htype(), packets_set_op(), packets_set_option(), packets_set_secs(), packets_set_siaddr(), packets_set_xid(), remove_option_from_profile(), global_config::server_ip_seen_by_client, op_control::taille, and TARGET_PORT. Referenced by find_ip_and_reply(). |