From 4959a89f421fdebc521f48003a79c2161e59d192 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Fri, 14 Nov 2014 11:19:10 -0800 Subject: Represent DHCP "origin" as an enum, not a string. See IBFT standard for location of "origin" field in iBFT table, and see MS document: http://msdn.microsoft.com/en-us/library/aa366281.aspx for description of enums, duplicated here in part: typedef enum { IpPrefixOriginOther = 0, IpPrefixOriginManual, IpPrefixOriginWellKnown, IpPrefixOriginDhcp, IpPrefixOriginRouterAdvertisement, IpPrefixOriginUnchanged = 16 } IP_PREFIX_ORIGIN; --- include/fw_context.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/fw_context.h b/include/fw_context.h index 295b54d..6a7ec1a 100644 --- a/include/fw_context.h +++ b/include/fw_context.h @@ -28,6 +28,15 @@ #include "list.h" #include "auth.h" +enum ibft_ip_prefix_origin { + IBFT_IP_PREFIX_ORIGIN_OTHER = 0, + IBFT_IP_PREFIX_ORIGIN_MANUAL, + IBFT_IP_PREFIX_ORIGIN_WELL_KNOWN, + IBFT_IP_PREFIX_ORIGIN_DHCP, + IBFT_IP_PREFIX_ORIGIN_ROUTER_ADVERTISEMENT, + IBFT_IP_PREFIX_ORIGIN_UNCHANGED = 16 +}; + struct boot_context { struct list_head list; char boot_root[BOOT_NAME_MAXLEN]; @@ -48,7 +57,7 @@ struct boot_context { char initiatorname[TARGET_NAME_MAXLEN + 1]; /* network settings */ - char origin[2]; + enum ibft_ip_prefix_origin origin; char dhcp[NI_MAXHOST]; char iface[IF_NAMESIZE]; char mac[18]; -- cgit v1.2.1