Struct:ttUserBtEntry

Jump to: navigation, search
 
#define trsocket.h
 
/*
 * Boot entry type. To store information collected from the BOOPT/DHCP server.
 */
typedef struct tsUserBtEntry
{
/* 2nd phase BOOT Server (TFTP server) */
    ttUserIpAddress                   btuBootSIpAddress;
/* Domain name server (for DNS) */
    ttUserIpAddress                   btuDns1ServerIpAddress;
/* Second domain name server (for DNS) */
    ttUserIpAddress                   btuDns2ServerIpAddress;
/* Our (leased) IP address */
    ttUserIpAddress                   btuYiaddr;
/* Our subnet mask */
    ttUserIpAddress                   btuNetMask;
/* Default router */
    ttUserIpAddress                   btuDefRouter;
/* Default router after lease renewal (if changed) */
    ttUserIpAddress                   btuLeaseDefRouter;
/* DHCP selected server IP address */
    ttUserIpAddress                   btuDhcpServerId;
/* Time stamp of DHCP request (Internal) */
    ttUser32Bit                       btuDhcpRequestTimeStamp;
/* DHCP Address lease time (internal) */
    ttUser32Bit                       btuDhcpLeaseTime;
/* DHCP T1 time (internal) */
    ttUser32Bit                       btuDhcpT1;
/* DHCP T2 time (internal) */
    ttUser32Bit                       btuDhcpT2;
/* Boot file size (in 512-bytes blocks) (for TFTP download) */
    unsigned short                    btuBootFileSize;
/* seconds since we started sending a BOOTP request/DHCP discover*/
    unsigned short                    btuSeconds;
#ifndef TM_DHCP_NBNS_NUM_SERVER
#define TM_DHCP_NBNS_NUM_SERVER       2
#endif /* TM_DHCP_NBNS_NUM_SERVER */
    ttUserIpAddress                   btuNetBiosNameServers[
                                          TM_DHCP_NBNS_NUM_SERVER];
    unsigned char                     btuNetBiosNumNameServers;
    unsigned char                     btuDhcpClientIdLength;
    unsigned char                     btuDhcpHostNameLength;
#ifndef TM_DHCP_CLIENTID_SIZE
#define TM_DHCP_CLIENTID_SIZE 16
#endif /* TM_DHCP_CLIENTID_SIZE */
    unsigned char                     btuDhcpClientIDPtr[
                                        ((TM_DHCP_CLIENTID_SIZE + 3) /4) * 4];
#ifndef TM_DHCP_HOSTNAME_SIZE
#define TM_DHCP_HOSTNAME_SIZE 16
#endif /* TM_DHCP_HOSTNAME_SIZE */
    unsigned char                     btuDhcpHostNamePtr[
                                        ((TM_DHCP_HOSTNAME_SIZE + 3) /4) * 4];
#ifndef TM_DHCP_RX_HOSTNAME_SIZE
#define TM_DHCP_RX_HOSTNAME_SIZE 16
#endif /* TM_DHCP_RX_HOSTNAME_SIZE */
/*
 * btuNames contains btuDhcpRxHostNamePtr, btuDomainName, btuBootSname,
 * btuBootFileName, and btuServerFqdn (ascii, and binary) pointers
 */
#ifdef TM_USE_DHCP_FQDN
#define TM_BTU_NAMES_MAX_INDEX  6
#else /* !TM_USE_DHCP_FQDN */
#define TM_BTU_NAMES_MAX_INDEX  4
#endif /* !TM_USE_DHCP_FQDN */
    unsigned char TM_FAR            * btuNames[TM_BTU_NAMES_MAX_INDEX];
/* Rx Host name */
#define TM_BT_RXHNAME_INDEX 0
#define btuDhcpRxHostNamePtr          btuNames[TM_BT_RXHNAME_INDEX]
/* Domain Name */
#define TM_BT_DOMAIN_INDEX  1
#define btuDomainName                 btuNames[TM_BT_DOMAIN_INDEX]
/* TFTP server name (for TFTP download) */
#define TM_BT_SNAME_INDEX   2
#define btuBootSname                  btuNames[TM_BT_SNAME_INDEX]
/* BOOTP or DHCP boot file name */
#define TM_BT_FNAME_INDEX   3
#define btuBootFileName               btuNames[TM_BT_FNAME_INDEX]
#ifdef TM_USE_DHCP_FQDN
#define TM_BT_FQDN_AINDEX   4 /* Ascii FQDN */
#define TM_BT_FQDN_BINDEX   5 /* Binary FQDN */
#define btuServerFqdn                 btuNames[TM_BT_FQDN_AINDEX]
#define btuServerBFqdn                btuNames[TM_BT_FQDN_BINDEX]
#endif /* TM_USE_DHCP_FQDN */
/* Domain name (64 bytes) (for DNS) */
/* TFTP server name (64 bytes) (for TFTP download) */
#define TM_BOOTSNAME_SIZE             64
/* BOOTP or DHCP boot file name array size */
#define TM_BOOTFILENAME_SIZE          128
/*
 * btuNamesLengths contains btuDhcpRxHostNameLength, btuDonameName length,
 * btuBootSname length, btuBootFileName.
 */
#define btuDhcpRxHostNameLength       btuNamesLengths[TM_BT_RXHNAME_INDEX]
#define btuDhcpFqdnALength            btuNamesLengths[TM_BT_FQDN_AINDEX]
#define btuDhcpFqdnBLength            btuNamesLengths[TM_BT_FQDN_BINDEX]
    ttUser16Bit                       btuNamesLengths[
                                        ((TM_BTU_NAMES_MAX_INDEX + 2)/2) * 2];
/* 
 * btuDhcpRxHostNamePtr, btuDomainName, btuBootSname, and btuBootFileName
 * point into this array when they are empty so that they can point to a null
 * terminated empty string.
 */
    unsigned char                     btuNamesZeroArray[
                                        ((TM_BTU_NAMES_MAX_INDEX + 3)/4) * 4];
#ifdef TM_USE_DHCP_FQDN
    int                               btuServerFqdnLen;
    int                               btuFqdnStatus;
#define btuFqdnOptionFlags            btuFqdnArray[0]
#define btuFqdnRCode1                 btuFqdnArray[1]
#define btuFqdnRCode2                 btuFqdnArray[2]
#define btuFqdnRcvOffset              btuFqdnArray[3]
    unsigned char                     btuFqdnArray[4];
#endif /* TM_USE_DHCP_FQDN */
} ttUserBtEntry;
 
typedef ttUserBtEntry TM_FAR * ttUserBtEntryPtr;