aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/dhcp/client.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/dhcp/client.h')
-rw-r--r--src/vnet/dhcp/client.h77
1 files changed, 43 insertions, 34 deletions
diff --git a/src/vnet/dhcp/client.h b/src/vnet/dhcp/client.h
index 68c3d7ba98e..d9c7e25d0b2 100644
--- a/src/vnet/dhcp/client.h
+++ b/src/vnet/dhcp/client.h
@@ -27,13 +27,15 @@ _(DHCP_DISCOVER) \
_(DHCP_REQUEST) \
_(DHCP_BOUND)
-typedef enum {
+typedef enum
+{
#define _(a) a,
foreach_dhcp_client_state
#undef _
} dhcp_client_state_t;
-typedef struct {
+typedef struct
+{
dhcp_client_state_t state;
/* the interface in question */
@@ -50,73 +52,80 @@ typedef struct {
u32 transaction_id;
/* leased address, other learned info DHCP */
- ip4_address_t leased_address; /* from your_ip_address field */
+ ip4_address_t leased_address; /* from your_ip_address field */
ip4_address_t dhcp_server;
- u32 subnet_mask_width; /* option 1 */
- ip4_address_t router_address; /* option 3 */
- u32 lease_renewal_interval; /* option 51 */
- u32 lease_lifetime; /* option 59 */
+ u32 subnet_mask_width; /* option 1 */
+ ip4_address_t router_address; /* option 3 */
+ u32 lease_renewal_interval; /* option 51 */
+ u32 lease_lifetime; /* option 59 */
/* Requested data (option 55) */
- u8 * option_55_data;
+ u8 *option_55_data;
- u8 * l2_rewrite;
+ u8 *l2_rewrite;
/* hostname and software client identifiers */
- u8 * hostname;
- u8 * client_identifier; /* software version, e.g. vpe 1.0*/
+ u8 *hostname;
+ u8 *client_identifier; /* software version, e.g. vpe 1.0 */
/* Information used for event callback */
u32 client_index;
u32 pid;
- void * event_callback;
+ void *event_callback;
} dhcp_client_t;
-typedef struct {
+typedef struct
+{
/* DHCP client pool */
- dhcp_client_t * clients;
- uword * client_by_sw_if_index;
+ dhcp_client_t *clients;
+ uword *client_by_sw_if_index;
u32 seed;
/* convenience */
- vlib_main_t * vlib_main;
- vnet_main_t * vnet_main;
+ vlib_main_t *vlib_main;
+ vnet_main_t *vnet_main;
} dhcp_client_main_t;
-typedef struct {
+typedef struct
+{
int is_add;
u32 sw_if_index;
/* vectors, consumed by dhcp client code */
- u8 * hostname;
- u8 * client_identifier;
+ u8 *hostname;
+ u8 *client_identifier;
/* Bytes containing requested option numbers */
- u8 * option_55_data;
+ u8 *option_55_data;
/* Information used for event callback */
u32 client_index;
u32 pid;
- void * event_callback;
+ void *event_callback;
} dhcp_client_add_del_args_t;
extern dhcp_client_main_t dhcp_client_main;
#define EVENT_DHCP_CLIENT_WAKEUP 1
-int dhcp_client_for_us (u32 bi0,
- vlib_buffer_t * b0,
- ip4_header_t * ip0,
- udp_header_t * u0,
- dhcp_header_t * dh0);
+int dhcp_client_for_us (u32 bi0,
+ vlib_buffer_t * b0,
+ ip4_header_t * ip0,
+ udp_header_t * u0, dhcp_header_t * dh0);
int dhcp_client_config (vlib_main_t * vm,
- u32 sw_if_index,
- u8 * hostname,
- u8 * client_id,
- u32 is_add,
- u32 client_index,
- void *event_callback,
- u32 pid);
+ u32 sw_if_index,
+ u8 * hostname,
+ u8 * client_id,
+ u32 is_add,
+ u32 client_index, void *event_callback, u32 pid);
#endif /* included_dhcp_client_h */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */