Files
2026-07-30 11:19:44 +05:30

148 lines
4.0 KiB
C

/*
******************************************************************************
* INTERPEAK API HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdhcps6_duid.h,v $ $Revision: 1.4 $
* $Source: /home/interpeak/CVSRoot/ipdhcps6/include/ipdhcps6_duid.h,v $
* $Author: kenneth $ $Date: 2004-05-27 11:15:01 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Kenneth Jonsson <kenneth@interpeak.se>
******************************************************************************
*/
#ifndef IPDHCPS6_DUID_H
#define IPDHCPS6_DUID_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
#include "ipdhcps6_config.h"
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/* Link-layer address plus time */
#define IPDHCPS6_DUID_LLT 1
/* Vendor-assigned unique ID based on Enterprise Number */
#define IPDHCPS6_DUID_EN 2
/* Link-layer address */
#define IPDHCPS6_DUID_LL 3
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/* Generic format for DHCP Unique IDentification */
struct Ipdhcps6_duid_generic
{
/* The type of DUID this is */
Ip_u16 content;
Ip_u8 data[1];
};
/* DUID Based on Link-layer Address Plus Time */
struct Ipdhcps6_duid_llt_data
{
/* Content is always IPDHCPS6_DUID_LLT for this type */
Ip_u16 content;
/* Link layer hardware type */
Ip_u16 hardware_type;
/* Time when this DUID was created */
Ip_u32 time;
/* Link layer address from one of the interfaces (variable length) */
Ip_u8 link_addr[6];
};
/* DUID Assigned by Vendor Based on Enterprise Number */
struct Ipdhcps6_duid_en_data
{
/* Content is always IPDHCPS6_DUID_EN for this type */
Ip_u16 content;
/* Vendor's registered Private Enterprise Number as maintained by IANA */
Ip_u16 enterprise_number_1;
Ip_u16 enterprise_number_2;
/* Vendor specified ID (variable length) */
Ip_u8 id[1];
};
/* DUID Based on Link-layer Address */
struct Ipdhcps6_duid_ll_data
{
/* Content is always IPDHCPS6_DUID_LL for this type */
Ip_u16 content;
/* Link layer hardware type */
Ip_u16 hardware_type;
/* Link layer address from one of the interfaces (variable length) */
Ip_u8 link_addr[6];
};
union Ipdhcps6_duid_data
{
struct Ipdhcps6_duid_generic generic;
struct Ipdhcps6_duid_llt_data llt;
struct Ipdhcps6_duid_en_data en;
struct Ipdhcps6_duid_ll_data ll;
};
typedef struct Ipdhcps6_duid_struct
{
/* The length of DUID data */
Ip_u16 len;
union Ipdhcps6_duid_data data;
}
Ipdhcps6_duid;
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
IP_GLOBAL Ip_err ipdhcps6_duid_initialize(void);
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/