📄 dhcpd.h
字号:
#define SV_USE_LEASE_ADDR_FOR_DEFAULT_ROUTE 13#define SV_MIN_SECS 14#define SV_FILENAME 15#define SV_SERVER_NAME 16#define SV_NEXT_SERVER 17#define SV_AUTHORITATIVE 18#define SV_VENDOR_OPTION_SPACE 19#define SV_ALWAYS_REPLY_RFC1048 20#define SV_SITE_OPTION_SPACE 21#define SV_ALWAYS_BROADCAST 22#define SV_DDNS_DOMAIN_NAME 23#define SV_DDNS_HOST_NAME 24#define SV_DDNS_REV_DOMAIN_NAME 25#define SV_LEASE_FILE_NAME 26#define SV_PID_FILE_NAME 27#define SV_DUPLICATES 28#define SV_DECLINES 29#define SV_DDNS_UPDATES 30#define SV_OMAPI_PORT 31#define SV_LOCAL_PORT 32#define SV_LIMITED_BROADCAST_ADDRESS 33#define SV_REMOTE_PORT 34#define SV_LOCAL_ADDRESS 35#define SV_OMAPI_KEY 36#define SV_STASH_AGENT_OPTIONS 37#define SV_DDNS_TTL 38#define SV_DDNS_UPDATE_STYLE 39#define SV_CLIENT_UPDATES 40#define SV_UPDATE_OPTIMIZATION 41#define SV_PING_CHECKS 42#define SV_UPDATE_STATIC_LEASES 43#define SV_LOG_FACILITY 44#define SV_DO_FORWARD_UPDATES 45#define SV_PING_TIMEOUT 46#if !defined (DEFAULT_PING_TIMEOUT)# define DEFAULT_PING_TIMEOUT 1#endif#if !defined (DEFAULT_DEFAULT_LEASE_TIME)# define DEFAULT_DEFAULT_LEASE_TIME 43200#endif#if !defined (DEFAULT_MIN_LEASE_TIME)# define DEFAULT_MIN_LEASE_TIME 0#endif#if !defined (DEFAULT_MAX_LEASE_TIME)# define DEFAULT_MAX_LEASE_TIME 86400#endif#if !defined (DEFAULT_DDNS_TTL)# define DEFAULT_DDNS_TTL 3600#endif/* Client option names */#define CL_TIMEOUT 1#define CL_SELECT_INTERVAL 2#define CL_REBOOT_TIMEOUT 3#define CL_RETRY_INTERVAL 4#define CL_BACKOFF_CUTOFF 5#define CL_INITIAL_INTERVAL 6#define CL_BOOTP_POLICY 7#define CL_SCRIPT_NAME 8#define CL_REQUESTED_OPTIONS 9#define CL_REQUESTED_LEASE_TIME 10#define CL_SEND_OPTIONS 11#define CL_MEDIA 12#define CL_REJECT_LIST 13#ifndef CL_DEFAULT_TIMEOUT# define CL_DEFAULT_TIMEOUT 60#endif#ifndef CL_DEFAULT_SELECT_INTERVAL# define CL_DEFAULT_SELECT_INTERVAL 0#endif#ifndef CL_DEFAULT_REBOOT_TIMEOUT# define CL_DEFAULT_REBOOT_TIMEOUT 10#endif#ifndef CL_DEFAULT_RETRY_INTERVAL# define CL_DEFAULT_RETRY_INTERVAL 300#endif#ifndef CL_DEFAULT_BACKOFF_CUTOFF# define CL_DEFAULT_BACKOFF_CUTOFF 120#endif#ifndef CL_DEFAULT_INITIAL_INTERVAL# define CL_DEFAULT_INITIAL_INTERVAL 10#endif#ifndef CL_DEFAULT_BOOTP_POLICY# define CL_DEFAULT_BOOTP_POLICY P_ACCEPT#endif#ifndef CL_DEFAULT_REQUESTED_OPTIONS# define CL_DEFAULT_REQUESTED_OPTIONS \ { DHO_SUBNET_MASK, \ DHO_BROADCAST_ADDRESS, \ DHO_TIME_OFFSET, \ DHO_ROUTERS, \ DHO_DOMAIN_NAME, \ DHO_DOMAIN_NAME_SERVERS, \ DHO_HOST_NAME }#endifstruct group_object { OMAPI_OBJECT_PREAMBLE; struct group_object *n_dynamic; struct group *group; char *name; int flags;#define GROUP_OBJECT_DELETED 1#define GROUP_OBJECT_DYNAMIC 2#define GROUP_OBJECT_STATIC 4};/* Group of declarations that share common parameters. */struct group { struct group *next; int refcnt; struct group_object *object; struct subnet *subnet; struct shared_network *shared_network; int authoritative; struct executable_statement *statements;};/* A dhcp host declaration structure. */struct host_decl { OMAPI_OBJECT_PREAMBLE; struct host_decl *n_ipaddr; struct host_decl *n_dynamic; char *name; struct hardware interface; struct data_string client_identifier; struct option_cache *fixed_addr; struct group *group; struct group_object *named_group; struct data_string auth_key_id; int flags;#define HOST_DECL_DELETED 1#define HOST_DECL_DYNAMIC 2#define HOST_DECL_STATIC 4};struct permit { struct permit *next; enum { permit_unknown_clients, permit_known_clients, permit_authenticated_clients, permit_unauthenticated_clients, permit_all_clients, permit_dynamic_bootp_clients, permit_class } type; struct class *class;};struct pool { OMAPI_OBJECT_PREAMBLE; struct pool *next; struct group *group; struct shared_network *shared_network; struct permit *permit_list; struct permit *prohibit_list; struct lease *active; struct lease *expired; struct lease *free; struct lease *backup; struct lease *abandoned; TIME next_event_time; int lease_count; int free_leases; int backup_leases; int index;#if defined (FAILOVER_PROTOCOL) dhcp_failover_state_t *failover_peer;#endif};struct shared_network { OMAPI_OBJECT_PREAMBLE; struct shared_network *next; char *name; struct subnet *subnets; struct interface_info *interface; struct pool *pools; struct group *group;#if defined (FAILOVER_PROTOCOL) dhcp_failover_state_t *failover_peer;#endif};struct subnet { OMAPI_OBJECT_PREAMBLE; struct subnet *next_subnet; struct subnet *next_sibling; struct shared_network *shared_network; struct interface_info *interface; struct iaddr interface_address; struct iaddr net; struct iaddr netmask; struct group *group;};struct collection { struct collection *next; const char *name; struct class *classes;};/* XXX classes must be reference-counted. */struct class { OMAPI_OBJECT_PREAMBLE; struct class *nic; /* Next in collection. */ struct class *superclass; /* Set for spawned classes only. */ char *name; /* Not set for spawned classes. */ /* A class may be configured to permit a limited number of leases. */ int lease_limit; int leases_consumed; struct lease **billed_leases; /* If nonzero, class has not been saved since it was last modified. */ int dirty; /* Hash table containing subclasses. */ class_hash_t *hash; struct data_string hash_string; /* Expression used to match class. */ struct expression *expr; /* Expression used to compute subclass identifiers for spawning and to do subclass matching. */ struct expression *submatch; int spawning; struct group *group; /* Statements to execute if class matches. */ struct executable_statement *statements;};/* DHCP client lease structure... */struct client_lease { struct client_lease *next; /* Next lease in list. */ TIME expiry, renewal, rebind; /* Lease timeouts. */ struct iaddr address; /* Address being leased. */ char *server_name; /* Name of boot server. */ char *filename; /* Name of file we're supposed to boot. */ struct string_list *medium; /* Network medium. */ struct auth_key *key; /* Key used in basic DHCP authentication. */ unsigned int is_static : 1; /* If set, lease is from config file. */ unsigned int is_bootp: 1; /* If set, lease was acquired with BOOTP. */ struct option_state *options; /* Options supplied with lease. */};/* Possible states in which the client can be. */enum dhcp_state { S_REBOOTING = 1, S_INIT = 2, S_SELECTING = 3, S_REQUESTING = 4, S_BOUND = 5, S_RENEWING = 6, S_REBINDING = 7, S_STOPPED = 8};/* Authentication and BOOTP policy possibilities (not all values work for each). */enum policy { P_IGNORE, P_ACCEPT, P_PREFER, P_REQUIRE, P_DONT };/* Configuration information from the config file... */struct client_config { /* * When a message has been received, run these statements * over it. */ struct group *on_receipt; /* * When a message is sent, run these statements. */ struct group *on_transmission; u_int32_t *required_options; /* Options server must supply. */ u_int32_t *requested_options; /* Options to request from server. */ TIME timeout; /* Start to panic if we don't get a lease in this time period when SELECTING. */ TIME initial_interval; /* All exponential backoff intervals start here. */ TIME retry_interval; /* If the protocol failed to produce an address before the timeout, try the protocol again after this many seconds. */ TIME select_interval; /* Wait this many seconds from the first DHCPDISCOVER before picking an offered lease. */ TIME reboot_timeout; /* When in INIT-REBOOT, wait this long before giving up and going to INIT. */ TIME backoff_cutoff; /* When doing exponential backoff, never back off to an interval longer than this amount. */ u_int32_t requested_lease; /* Requested lease time, if user doesn't configure one. */ struct string_list *media; /* Possible network media values. */ char *script_name; /* Name of config script. */ char *vendor_space_name; /* Name of config script. */ enum policy bootp_policy; /* Ignore, accept or prefer BOOTP responses. */ enum policy auth_policy; /* Require authentication, prefer authentication, or don't try to authenticate. */ struct string_list *medium; /* Current network medium. */ struct iaddrlist *reject_list; /* Servers to reject. */ int omapi_port; /* port on which to accept OMAPI connections, or -1 for no listener. */ int do_forward_update; /* If nonzero, and if we have the information we need, update the A record for the address we get. */};/* Per-interface state used in the dhcp client... */struct client_state { struct client_state *next; struct interface_info *interface; char *name; struct client_lease *active; /* Currently active lease. */ struct client_lease *new; /* New lease. */ struct client_lease *offered_leases; /* Leases offered to us. */ struct client_lease *leases; /* Leases we currently hold. */ struct client_lease *alias; /* Alias lease. */ enum dhcp_state state; /* Current state for this interface. */ struct iaddr destination; /* Where to send packet. */ u_int32_t xid; /* Transaction ID. */ u_int16_t secs; /* secs value from DHCPDISCOVER. */ TIME first_sending; /* When was first copy sent? */ TIME interval; /* What's the current resend interval? */ int dns_update_timeout; /* Last timeout set for DNS update. */ struct string_list *medium; /* Last media type tried. */ struct dhcp_packet packet; /* Outgoing DHCP packet. */ unsigned packet_length; /* Actual length of generated packet. */ struct iaddr requested_address; /* Address we would like to get. */ struct client_config *config; /* Client configuration. */ struct string_list *env; /* Client script environment. */ int envc; /* Number of entries in environment. */ struct option_state *sent_options; /* Options we sent. */};/* Information about each network interface. */struct interface_info {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -