Changeset View
Changeset View
Standalone View
Standalone View
sbin/dhclient/dhcpd.h
Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | struct protocol { | ||||
void (*handler)(struct protocol *); | void (*handler)(struct protocol *); | ||||
void *local; | void *local; | ||||
}; | }; | ||||
#define DEFAULT_HASH_SIZE 97 | #define DEFAULT_HASH_SIZE 97 | ||||
struct hash_bucket { | struct hash_bucket { | ||||
struct hash_bucket *next; | struct hash_bucket *next; | ||||
unsigned char *name; | const unsigned char *name; | ||||
int len; | int len; | ||||
unsigned char *value; | unsigned char *value; | ||||
}; | }; | ||||
struct hash_table { | struct hash_table { | ||||
int hash_count; | int hash_count; | ||||
struct hash_bucket *buckets[DEFAULT_HASH_SIZE]; | struct hash_bucket *buckets[DEFAULT_HASH_SIZE]; | ||||
}; | }; | ||||
/* Default path to dhcpd config file. */ | /* Default path to dhcpd config file. */ | ||||
#define _PATH_DHCLIENT_CONF "/etc/dhclient.conf" | #define _PATH_DHCLIENT_CONF "/etc/dhclient.conf" | ||||
#define _PATH_DHCLIENT_DB "/var/db/dhclient.leases" | #define _PATH_DHCLIENT_DB "/var/db/dhclient.leases" | ||||
#define DHCPD_LOG_FACILITY LOG_DAEMON | #define DHCPD_LOG_FACILITY LOG_DAEMON | ||||
#define MAX_TIME 0x7fffffff | #define MAX_TIME 0x7fffffff | ||||
#define MIN_TIME 0 | #define MIN_TIME 0 | ||||
/* External definitions... */ | /* External definitions... */ | ||||
/* options.c */ | /* options.c */ | ||||
int cons_options(struct packet *, struct dhcp_packet *, int, | int cons_options(struct packet *, struct dhcp_packet *, int, | ||||
struct tree_cache **, int, int, int, u_int8_t *, int); | struct tree_cache **, int, int, int, u_int8_t *, int); | ||||
char *pretty_print_option(unsigned int, | const char *pretty_print_option(unsigned int, | ||||
unsigned char *, int, int, int); | unsigned char *, int, int, int); | ||||
void do_packet(struct interface_info *, struct dhcp_packet *, | void do_packet(struct interface_info *, struct dhcp_packet *, | ||||
int, unsigned int, struct iaddr, struct hardware *); | int, unsigned int, struct iaddr, struct hardware *); | ||||
/* errwarn.c */ | /* errwarn.c */ | ||||
extern int warnings_occurred; | extern int warnings_occurred; | ||||
void error(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); | void error(const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); | ||||
int warning(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); | int warning(const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); | ||||
int note(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); | int note(const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); | ||||
int debug(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); | int debug(const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); | ||||
int parse_warn(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); | int parse_warn(const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); | ||||
/* conflex.c */ | /* conflex.c */ | ||||
extern int lexline, lexchar; | extern int lexline, lexchar; | ||||
extern char *token_line, *tlname; | extern char *token_line; | ||||
extern const char *tlname; | |||||
extern char comments[4096]; | extern char comments[4096]; | ||||
extern int comment_index; | extern int comment_index; | ||||
extern int eol_token; | extern int eol_token; | ||||
void new_parse(char *); | void new_parse(const char *); | ||||
int next_token(char **, FILE *); | int next_token(char **, FILE *); | ||||
int peek_token(char **, FILE *); | int peek_token(char **, FILE *); | ||||
/* parse.c */ | /* parse.c */ | ||||
void skip_to_semi(FILE *); | void skip_to_semi(FILE *); | ||||
int parse_semi(FILE *); | int parse_semi(FILE *); | ||||
char *parse_string(FILE *); | char *parse_string(FILE *); | ||||
int parse_ip_addr(FILE *, struct iaddr *); | int parse_ip_addr(FILE *, struct iaddr *); | ||||
Show All 27 Lines | |||||
extern void (*bootp_packet_handler)(struct interface_info *, | extern void (*bootp_packet_handler)(struct interface_info *, | ||||
struct dhcp_packet *, int, unsigned int, struct iaddr, struct hardware *); | struct dhcp_packet *, int, unsigned int, struct iaddr, struct hardware *); | ||||
void discover_interfaces(struct interface_info *); | void discover_interfaces(struct interface_info *); | ||||
void reinitialize_interfaces(void); | void reinitialize_interfaces(void); | ||||
void dispatch(void); | void dispatch(void); | ||||
void got_one(struct protocol *); | void got_one(struct protocol *); | ||||
void add_timeout(time_t, void (*)(void *), void *); | void add_timeout(time_t, void (*)(void *), void *); | ||||
void cancel_timeout(void (*)(void *), void *); | void cancel_timeout(void (*)(void *), void *); | ||||
void add_protocol(char *, int, void (*)(struct protocol *), void *); | void add_protocol(const char *, int, void (*)(struct protocol *), void *); | ||||
void remove_protocol(struct protocol *); | void remove_protocol(struct protocol *); | ||||
int interface_link_status(char *); | int interface_link_status(char *); | ||||
void interface_set_mtu_unpriv(int, u_int16_t); | void interface_set_mtu_unpriv(int, u_int16_t); | ||||
void interface_set_mtu_priv(char *, u_int16_t); | void interface_set_mtu_priv(char *, u_int16_t); | ||||
/* hash.c */ | /* hash.c */ | ||||
struct hash_table *new_hash(void); | struct hash_table *new_hash(void); | ||||
void add_hash(struct hash_table *, unsigned char *, int, unsigned char *); | void add_hash(struct hash_table *, const unsigned char *, int, unsigned char *); | ||||
unsigned char *hash_lookup(struct hash_table *, unsigned char *, int); | void *hash_lookup(struct hash_table *, unsigned char *, int); | ||||
/* tables.c */ | /* tables.c */ | ||||
extern struct option dhcp_options[256]; | extern struct option dhcp_options[256]; | ||||
extern unsigned char dhcp_option_default_priority_list[]; | extern unsigned char dhcp_option_default_priority_list[]; | ||||
extern int sizeof_dhcp_option_default_priority_list; | extern int sizeof_dhcp_option_default_priority_list; | ||||
extern struct hash_table universe_hash; | extern struct hash_table universe_hash; | ||||
extern struct universe dhcp_universe; | extern struct universe dhcp_universe; | ||||
void initialize_universes(void); | void initialize_universes(void); | ||||
Show All 11 Lines | |||||
/* inet.c */ | /* inet.c */ | ||||
struct iaddr subnet_number(struct iaddr, struct iaddr); | struct iaddr subnet_number(struct iaddr, struct iaddr); | ||||
struct iaddr broadcast_addr(struct iaddr, struct iaddr); | struct iaddr broadcast_addr(struct iaddr, struct iaddr); | ||||
int addr_eq(struct iaddr, struct iaddr); | int addr_eq(struct iaddr, struct iaddr); | ||||
char *piaddr(struct iaddr); | char *piaddr(struct iaddr); | ||||
/* dhclient.c */ | /* dhclient.c */ | ||||
extern cap_channel_t *capsyslog; | extern cap_channel_t *capsyslog; | ||||
extern char *path_dhclient_conf; | extern const char *path_dhclient_conf; | ||||
extern char *path_dhclient_db; | extern char *path_dhclient_db; | ||||
extern time_t cur_time; | extern time_t cur_time; | ||||
extern int log_priority; | extern int log_priority; | ||||
extern int log_perror; | extern int log_perror; | ||||
extern struct client_config top_level_config; | extern struct client_config top_level_config; | ||||
extern struct pidfh *pidfile; | extern struct pidfh *pidfile; | ||||
Show All 18 Lines | |||||
void make_discover(struct interface_info *, struct client_lease *); | void make_discover(struct interface_info *, struct client_lease *); | ||||
void make_request(struct interface_info *, struct client_lease *); | void make_request(struct interface_info *, struct client_lease *); | ||||
void make_decline(struct interface_info *, struct client_lease *); | void make_decline(struct interface_info *, struct client_lease *); | ||||
void free_client_lease(struct client_lease *); | void free_client_lease(struct client_lease *); | ||||
void rewrite_client_leases(void); | void rewrite_client_leases(void); | ||||
void write_client_lease(struct interface_info *, struct client_lease *, int); | void write_client_lease(struct interface_info *, struct client_lease *, int); | ||||
void priv_script_init(char *, char *); | void priv_script_init(const char *, char *); | ||||
void priv_script_write_params(char *, struct client_lease *); | void priv_script_write_params(const char *, struct client_lease *); | ||||
int priv_script_go(void); | int priv_script_go(void); | ||||
void script_init(char *, struct string_list *); | void script_init(const char *, struct string_list *); | ||||
void script_write_params(char *, struct client_lease *); | void script_write_params(const char *, struct client_lease *); | ||||
int script_go(void); | int script_go(void); | ||||
void client_envadd(struct client_state *, | void client_envadd(struct client_state *, | ||||
const char *, const char *, const char *, ...); | const char *, const char *, const char *, ...); | ||||
void script_set_env(struct client_state *, const char *, const char *, | void script_set_env(struct client_state *, const char *, const char *, | ||||
const char *); | const char *); | ||||
void script_flush_env(struct client_state *); | void script_flush_env(struct client_state *); | ||||
int dhcp_option_ev_name(char *, size_t, struct option *); | int dhcp_option_ev_name(char *, size_t, struct option *); | ||||
Show All 27 Lines | |||||
void parse_client_lease_declaration(FILE *, struct client_lease *, | void parse_client_lease_declaration(FILE *, struct client_lease *, | ||||
struct interface_info **); | struct interface_info **); | ||||
struct option *parse_option_decl(FILE *, struct option_data *); | struct option *parse_option_decl(FILE *, struct option_data *); | ||||
void parse_string_list(FILE *, struct string_list **, int); | void parse_string_list(FILE *, struct string_list **, int); | ||||
void parse_reject_statement(FILE *, struct client_config *); | void parse_reject_statement(FILE *, struct client_config *); | ||||
/* privsep.c */ | /* privsep.c */ | ||||
struct buf *buf_open(size_t); | struct buf *buf_open(size_t); | ||||
int buf_add(struct buf *, void *, size_t); | int buf_add(struct buf *, const void *, size_t); | ||||
int buf_close(int, struct buf *); | int buf_close(int, struct buf *); | ||||
ssize_t buf_read(int, void *, size_t); | ssize_t buf_read(int, void *, size_t); | ||||
void dispatch_imsg(struct interface_info *, int); | void dispatch_imsg(struct interface_info *, int); |