]> git.proxmox.com Git - mirror_ovs.git/blobdiff - lib/dhcp.h
ofp-actions: Fix userspace support for mpls_ttl.
[mirror_ovs.git] / lib / dhcp.h
index 8858cd599e1910e49ec407fc74ece67c4e508841..c904af6c4648436518278600d5f4afcb11aa023e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011 Nicira Networks.
+ * Copyright (c) 2008, 2011 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #define DHCP_SERVER_PORT        67       /* Port used by DHCP server. */
 #define DHCP_CLIENT_PORT        68       /* Port used by DHCP client. */
 
+#define DHCP_MAGIC_COOKIE 0x63825363
+
 #define DHCP_HEADER_LEN 236
+OVS_PACKED(
 struct dhcp_header {
     uint8_t op;                 /* DHCP_BOOTREQUEST or DHCP_BOOTREPLY. */
     uint8_t htype;              /* ARP_HRD_ETHERNET (typically). */
@@ -42,7 +45,21 @@ struct dhcp_header {
     char sname[64];             /* Optional server host name. */
     char file[128];             /* Boot file name. */
     /* Followed by variable-length options field. */
-};
+});
 BUILD_ASSERT_DECL(DHCP_HEADER_LEN == sizeof(struct dhcp_header));
 
+#define DHCP_OP_REQUEST    1
+#define DHCP_OP_REPLY      2
+
+#define DHCP_MSG_DISCOVER  1
+#define DHCP_MSG_OFFER     2
+#define DHCP_MSG_REQUEST   3
+#define DHCP_MSG_ACK       5
+#define DHCP_MSG_NAK       6
+
+#define DHCP_OPT_PAD       0
+#define DHCP_OPT_REQ_IP    50
+#define DHCP_OPT_MSG_TYPE  53
+#define DHCP_OPT_END       255
+
 #endif /* dhcp.h */