#include "server_config.h"
#include "packets_operations.h"
#include "dhcp.h"
Go to the source code of this file.
Functions | |
void | clear_profile (struct opt *options) |
Reset option profile to "all zeros". More... | |
int | add_option_to_profile (struct opt *mprofile, int option, char *type, char *value, int len) |
Add an option to the loaded profile. More... | |
int | remove_option_from_profile (struct opt *mprofile, int option) |
Remove an option from the loaded profile. More... | |
void | context2profile (struct opt *profile, struct mysql_tables *mysql_tables) |
Copy the options' profile extracted from the client's context into a 'opt' data structure (used to assemble the output DHCP packet). More... | |
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 | 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... | |
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 | 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... | |
Variables | |
global_config | configuration_globale |
Global DHCP configuration handler. |
Definition in file packets_operations.c.
|
Add an option to the loaded profile.
Definition at line 64 of file packets_operations.c. References ascii_to_binary(), hexa_to_binary(), ip_to_network_byte_order(), global_config::log_file, my_syslog(), uint16_to_network_byte_order(), uint32_to_network_byte_order(), and VALUE_MAX_SIZE. Referenced by packets_send_ack(), packets_send_nack(), packets_send_offer(), and reply_to_inform(). |
|
Reset option profile to "all zeros".
Definition at line 33 of file packets_operations.c. References opt::code, opt::len, MAX_PROFILE_OPTIONS, and VALUE_MAX_SIZE. Referenced by context2profile(), and packets_send_nack(). |
|
Copy the options' profile extracted from the client's context into a 'opt' data structure (used to assemble the output DHCP packet).
Definition at line 183 of file packets_operations.c. References ascii_to_binary(), clear_profile(), hexa_to_binary(), ip_to_network_byte_order(), global_config::log_file, my_syslog(), mysql_tables::option_number, mysql_tables::options, uint16_to_network_byte_order(), uint32_to_network_byte_order(), and VALUE_MAX_SIZE. Referenced by packets_send_ack(), packets_send_offer(), and reply_to_inform(). |
|
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_abonne_ip::gateway, table_ip_lease::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_abonne_ip::subnet, table_ip_lease::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_abonne_ip::gateway, table_ip_lease::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_abonne_ip::subnet, table_ip_lease::subnet, op_control::taille, and TARGET_PORT. Referenced by find_ip_and_reply(). |
|
Remove an option from the loaded profile.
Definition at line 146 of file packets_operations.c. References global_config::log_file, my_syslog(), and VALUE_MAX_SIZE. Referenced by reply_to_inform(). |
|
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(). |