Files
m241Neelima/components/ip_net2-6.9/ipdhcpc6/include/ipdhcpc6_attr.h
T
2026-07-30 11:19:44 +05:30

632 lines
30 KiB
C

/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdhcpc6_attr.h,v $ $Revision: 1.14.38.3 $
* $Source: /home/interpeak/CVSRoot/ipdhcpc6/include/ipdhcpc6_attr.h,v $
* $Author: jren $ $Date: 2015-06-29 08:24:49 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Joel Hortelius <joel.hortelius@interpeak.se>
******************************************************************************
*/
#ifndef IPDHCPC6_ATTR_H
#define IPDHCPC6_ATTR_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#include "ipdhcpc6_tagcomm.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
#define IPDHCPC6_ATTR_TAG_STATUS_UNKNOWN_INTERFACE (IPDHCPC6_TAGCOMM_USER_DEFINED + 1)
#define IPDHCPC6_ATTR_TAG_STATUS_UNKNOWN_IA (IPDHCPC6_TAGCOMM_USER_DEFINED + 2)
#define IPDHCPC6_CMD_IA_INFO IPDHCPC6_TAGCOMM_TAG_CMD(1)
#define IPDHCPC6_CMD_IA_REFRESH IPDHCPC6_TAGCOMM_TAG_CMD(2)
#define IPDHCPC6_CMD_IA_RELEASE IPDHCPC6_TAGCOMM_TAG_CMD(3)
#define IPDHCPC6_CMD_IA_HISTORY_FLUSH IPDHCPC6_TAGCOMM_TAG_CMD(4)
#define IPDHCPC6_CMD_IA_RTSOL IPDHCPC6_TAGCOMM_TAG_CMD(5)
#define IPDHCPC6_CMD_IA_BOUND_ADD IPDHCPC6_TAGCOMM_TAG_CMD(6)
#define IPDHCPC6_CMD_IA_BOUND_DEL IPDHCPC6_TAGCOMM_TAG_CMD(7)
#define IPDHCPC6_IA_OBJECT_IF IPDHCPC6_TAGCOMM_TAG_OBJ(100) /* attribute if list */
/* IPDHCPC6_IA_IDENT_NAME */
# define IPDHCPC6_IA_ATTR_IF_MODE IPDHCPC6_TAGCOMM_TAG_ATTR(101) /* u32: mode of interface */
# define IPDHCPC6_IA_ATTR_IF_LINK_STATE IPDHCPC6_TAGCOMM_TAG_ATTR(102) /* u32: state of interface */
# define IPDHCPC6_IA_ATTR_IF_VR IPDHCPC6_TAGCOMM_TAG_ATTR(103) /* int: VR */
# define IPDHCPC6_IA_OBJECT_IF_CONFIG IPDHCPC6_TAGCOMM_TAG_OBJ(200) /* attribute if config list */
# define IPDHCPC6_IA_ATTR_IF_CONFIG_RAPID_COMMIT IPDHCPC6_TAGCOMM_TAG_ATTR(201) /* u32: rapid commit E/D */
# define IPDHCPC6_IA_ATTR_IF_CONFIG_INFO_ONLY IPDHCPC6_TAGCOMM_TAG_ATTR(202) /* u32: information only commit E/D */
# define IPDHCPC6_IA_ATTR_IF_CONFIG_DNS IPDHCPC6_TAGCOMM_TAG_ATTR(203) /* u32: information only commit E/D */
# define IPDHCPC6_IA_ATTR_IF_CONFIG_SNTP IPDHCPC6_TAGCOMM_TAG_ATTR(204) /* u32: information only commit E/D */
# define IPDHCPC6_IA_ATTR_IF_CONFIG_INFO_REFRESH IPDHCPC6_TAGCOMM_TAG_OBJ(205) /* u32: enabled disabled */
# define IPDHCPC6_IA_ATTR_IF_CONFIG_SIP IPDHCPC6_TAGCOMM_TAG_OBJ(206) /* u32: information only commit E/D */
# define IPDHCPC6_IA_ATTR_IF_CONFIG_FQDN IPDHCPC6_TAGCOMM_TAG_ATTR(207) /* u32: enabled disabled */
# define IPDHCPC6_IA_OBJECT_IF_AUTOMATIC IPDHCPC6_TAGCOMM_TAG_OBJ(300) /* attribute if automatic list */
/* IPDHCPC6_IA_OBJECT_SERVER */
# define IPDHCPC6_IA_ATTR_IF_AUTOMATIC_MANAGED IPDHCPC6_TAGCOMM_TAG_ATTR(301) /* u32: managed E/D */
# define IPDHCPC6_IA_ATTR_IF_AUTOMATIC_OTHER IPDHCPC6_TAGCOMM_TAG_ATTR(302) /* u32: other information E/D */
# define IPDHCPC6_IA_OBJECT_IA IPDHCPC6_TAGCOMM_TAG_OBJ(400) /* attribute list */
/* IPDHCPC6_IA_OBJECT_SERVER */
/* IPDHCPC6_IA_ATTR_TIMESTAMP */
/* IPDHCPC6_IA_IDENT_NAME */
# define IPDHCPC6_IA_IDENT_IA_IANAME IPDHCPC6_TAGCOMM_TAG_IDENT(401)/* str: IA name */
# define IPDHCPC6_IA_IDENT_IA_IAID IPDHCPC6_TAGCOMM_TAG_IDENT(402)/* u32: IAID */
# define IPDHCPC6_IA_IDENT_IA_IATYPE IPDHCPC6_TAGCOMM_TAG_IDENT(403)/* u32: IATYPE */
# define IPDHCPC6_IA_ATTR_IA_T1 IPDHCPC6_TAGCOMM_TAG_ATTR(404) /* u32: T1 */
# define IPDHCPC6_IA_ATTR_IA_T2 IPDHCPC6_TAGCOMM_TAG_ATTR(405) /* u32: T2 */
# define IPDHCPC6_IA_ATTR_IA_T1_HINT IPDHCPC6_TAGCOMM_TAG_ATTR(406) /* u32: T1 HINT */
# define IPDHCPC6_IA_ATTR_IA_T2_HINT IPDHCPC6_TAGCOMM_TAG_ATTR(407) /* u32: T2 HINT */
# define IPDHCPC6_IA_OBJECT_STATE IPDHCPC6_TAGCOMM_TAG_OBJ(410) /* struct Ip_in6_addr: dhcp server */
/* IPDHCPC6_IA_ATTR_TIMESTAMP */
# define IPDHCPC6_IA_ATTR_STATE_STATUS IPDHCPC6_TAGCOMM_TAG_ATTR(411) /* u32: Status */
# define IPDHCPC6_IA_ATTR_STATE_ACTION IPDHCPC6_TAGCOMM_TAG_ATTR(412) /* u32: Action */
# define IPDHCPC6_IA_OBJECT_HISTORY IPDHCPC6_TAGCOMM_TAG_OBJ(429)
/* IPDHCPC6_IA_OBJECT_STATE */
# define IPDHCPC6_IA_OBJECT_BINDING IPDHCPC6_TAGCOMM_TAG_OBJ(430) /* attribute list */
# define IPDHCPC6_IA_OBJECT_BINDING_HINT IPDHCPC6_TAGCOMM_TAG_OBJ(431) /* attribute list */
/* IPDHCPC6_IA_ATTR_ADDRESS */
/* IPDHCPC6_IA_ATTR_TIMESTAMP */
# define IPDHCPC6_IA_ATTR_BINDING_PREFIX_PLEN IPDHCPC6_TAGCOMM_TAG_ATTR(432) /* struct u32: Prefix length */
# define IPDHCPC6_IA_ATTR_BINDING_PREFIX_PREFERRED IPDHCPC6_TAGCOMM_TAG_ATTR(433) /* struct u32: Preferred time */
# define IPDHCPC6_IA_ATTR_BINDING_PREFIX_VALID IPDHCPC6_TAGCOMM_TAG_ATTR(434) /* struct u32: Valid time */
# define IPDHCPC6_IA_ATTR_BINDING_PREFIX_STATUS IPDHCPC6_TAGCOMM_TAG_ATTR(435) /* struct u32: Valid time */
# define IPDHCPC6_IA_OBJECT_SERVER IPDHCPC6_TAGCOMM_TAG_OBJ(500) /* struct Ip_in6_addr: dhcp server */
/* IPDHCPC6_IA_IDENT_DUID */
/* IPDHCPC6_IA_ATTR_ADDRESS */
# define IPDHCPC6_IA_ATTR_SERVER_UNICAST IPDHCPC6_TAGCOMM_TAG_ATTR(501) /* struct Ip_in6_addr: dhcp server */
# define IPDHCPC6_IA_ATTR_SERVER_DNS_SERVER IPDHCPC6_TAGCOMM_TAG_ATTR(502) /* struct Ip_in6_addr: DNS server */
# define IPDHCPC6_IA_ATTR_SERVER_DOMAIN_LIST IPDHCPC6_TAGCOMM_TAG_ATTR(503) /* str: Domain Search List */
# define IPDHCPC6_IA_ATTR_SERVER_INFO_REFRESH IPDHCPC6_TAGCOMM_TAG_OBJ(504) /* u32: time interval */
# define IPDHCPC6_IA_ATTR_SERVER_SNTP_SERVER IPDHCPC6_TAGCOMM_TAG_ATTR(505) /* struct Ip_in6_addr: SNTP server */
# define IPDHCPC6_IA_ATTR_SERVER_SIP_D IPDHCPC6_TAGCOMM_TAG_ATTR(506) /* str: SIP server domain list */
# define IPDHCPC6_IA_ATTR_SERVER_SIP_A IPDHCPC6_TAGCOMM_TAG_ATTR(507) /* struct Ip_in6_addr: SIP server Address */
# define IPDHCPC6_IA_ATTR_SERVER_FQDN IPDHCPC6_TAGCOMM_TAG_ATTR(508) /* str: FQDN */
#define IPDHCPC6_IA_IDENT_DUID IPDHCPC6_TAGCOMM_TAG_IDENT(900)/* byte array: duid */
#define IPDHCPC6_IA_IDENT_NAME IPDHCPC6_TAGCOMM_TAG_IDENT(901)/* str: name */
#define IPDHCPC6_IA_ATTR_ADDRESS IPDHCPC6_TAGCOMM_TAG_ATTR(902) /* struct Ip_in6_addr */
#define IPDHCPC6_IA_ATTR_TIMESTAMP IPDHCPC6_TAGCOMM_TAG_ATTR(903) /* u32: timestamp */
#define IPDHCPC6_IA_ATTR_BIF_INFO IPDHCPC6_TAGCOMM_TAG_ATTR(904) /* str: bound interface name */
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
typedef void (*Ipdhcpc6_attr_array_free_t) (void **ptrp);
typedef struct Ipdhcpc6_attr_iaident
{
char *ianame;
Ip_u32 iaid;
} Ipdhcpc6_attr_iaident_t;
typedef struct Ipdhcpc6_attr_prefix
{
struct Ip_in6_addr addr;
Ip_u32 plen;
} Ipdhcpc6_attr_prefix_t;
typedef struct Ipdhcpc6_attr_array
{
Ip_u32 num;
Ip_u32 size;
void **array;
} Ipdhcpc6_attr_array_t;
typedef struct Ipdhcpc6_attr_binding
{
Ipdhcpc6_attr_prefix_t prefix; /* Prefix info for this binding */
Ip_u32 preferred; /* Preferred time */
Ip_u32 valid; /* Valid time */
Ip_u32 timestamp; /* Last time T1 / T2 was updated */
Ip_u32 status; /* IPDHCPC6_IA_ADDRESS_xx */
} Ipdhcpc6_attr_binding_t;
typedef struct Ipdhcpc6_attr_ia_binding
{
Ip_u32 T1; /* Renew */
Ip_u32 T2; /* Rebind */
Ip_u32 timestamp; /* Timestamp, relative to T1/T2 */
Ipdhcpc6_attr_array_t binding; /* Binding: preferred, valid, prefix, etc */
Ip_u32 status; /* Status of attribute action (tagcomm status) */
} Ipdhcpc6_attr_ia_binding_t;
typedef struct Ipdhcpc6_attr_if_server
{
struct Ip_in6_addr address; /* Server address */
struct Ip_in6_addr unicast; /* Unicast address for the server */
/* Identity vector */
void *id_vector;
Ip_size_t id_size;
Ip_u32 info_refresh; /* Information request interval */
Ipdhcpc6_attr_array_t dns; /* Collection of known DNS servers */
Ipdhcpc6_attr_array_t domain; /* Collection of known DNS domain names */
Ipdhcpc6_attr_array_t sntp; /* Collection of known SNTP servers */
Ipdhcpc6_attr_array_t sip_d; /* Collection of known sip servers Domain Name List */
Ipdhcpc6_attr_array_t sip_a; /* Collection of known sip servers IPv6 Address List */
Ipdhcpc6_attr_array_t fqdn; /* Collection of known FQDN */
Ipdhcpc6_attr_array_t vendor_spec_info; /* Collection of Vendor-specific Information Option */
Ip_u32 timestamp;
} Ipdhcpc6_attr_if_server_t;
typedef struct Ipdhcpc6_attr_ia_state
{
Ip_u32 timestamp; /* Time this ia state was updated */
Ip_u32 state; /* Identity association state (Bound, Solicit, etc) */
Ip_u32 action; /* Idle, Soliciting, Renewing, etc */
} Ipdhcpc6_attr_ia_state_t;
typedef struct Ipdhcpc6_attr_ia
{
Ip_u16 status; /* Status of attribute action (tagcomm status) */
Ip_u32 iatype; /* Identity association type */
char *ianame; /* Identity association name */
Ip_u32 iaid; /* Identity association identifier */
Ipdhcpc6_attr_ia_state_t state; /* Timestamp, state, action attributes */
Ipdhcpc6_attr_if_server_t *router; /* Server attributes */
Ipdhcpc6_attr_ia_binding_t hints; /* Collection of hints (preferred, valid, prefix, etc) */
Ipdhcpc6_attr_ia_binding_t bindings; /* Collection of actual bindings */
Ipdhcpc6_attr_array_t history; /* Collection of IA state (Ipdhcpc6_attr_ia_state) history */
} Ipdhcpc6_attr_ia_t;
/* Configuration attributes for this interface */
struct Ipdhcpc6_util_buffer;
typedef struct Ipdhcpc6_attr_if_config_fqdn
{
struct Ipdhcpc6_util_buffer *data; /*buffer for name configured*/
Ip_u32 fqdn; /*switch*/
Ip_u32 update; /*switch of updating*/
Ip_u32 request; /*swithch of requesting in oro*/
} Ipdhcpc6_attr_if_config_fqdn_t;
typedef struct Ipdhcpc6_attr_if_config
{
Ip_u32 rapid_commit;
Ip_u32 information_only;
Ip_u32 dns;
Ip_u32 sntp;
Ip_u32 info_refresh;
Ip_u32 sip;
Ip_u32 vendor_spec_info;
Ipdhcpc6_attr_if_config_fqdn_t fqdn; /*attribute for controling fqdn on interface*/
} Ipdhcpc6_attr_if_config_t;
typedef struct Ipdhcpc6_attr_if_runtime
{
Ip_u32 managed; /* Managed mode enabled / disabled */
Ip_u32 other; /* Other mode enabled / disabled */
} Ipdhcpc6_attr_if_runtime_t;
/* Configuration parameters for the interface container */
typedef struct Ipdhcpc6_attr_if_automatic
{
struct Ip_in6_addr rtr; /* Server addr */
Ipdhcpc6_attr_if_runtime_t runtime; /* Runtime mode (see Ipdhcpc6_attr_if_runtime_t */
} Ipdhcpc6_attr_if_automatic_t;
typedef struct Ipdhcpc6_attr_if
{
Ip_u16 status; /* Status of attribute action (tagcomm status) */
char *ifname; /* Interface name */
Ipdhcpc6_attr_if_automatic_t *automatic; /* See Ipdhcpc6_attr_if_automatic_t */
Ipdhcpc6_attr_if_config_t *config; /* Configuration attributes */
Ip_u32 state; /* Interface state (Up / Down / Detached) */
Ip_u32 mode; /* Interface mode (Enabled / Disabled / Automatic) */
int vr; /* VR */
Ipdhcpc6_attr_array_t ias; /* Collection of identity associations */
Ipdhcpc6_attr_array_t servers; /* Collection of known servers */
} Ipdhcpc6_attr_if_t;
/* Generic 'read' buffer structure */
typedef struct Ipdhcpc6_attr_readbuf
{
Ip_u8 *buffer;
Ip_size_t total_size;
Ip_size_t read_size;
} Ipdhcpc6_attr_readbuf_t;
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
extern char *ipdhcpc6_attr_if_link_state_name[];
extern char *ipdhcpc6_attr_mode_name[];
/*
*===========================================================================
* ipdhcpc6_attr_if_parse
*===========================================================================
* Description: Parse an IPDHCPC6_ATTR_IA_IF_OBJECT tag.
* Parameters: tag - The tag.
* mask - The type of objects we'll parse; 0 = all.
* Returns: The interface pointer with its associated IA/BINDINGS.
*
*/
IP_GLOBAL Ipdhcpc6_attr_if_t *ipdhcpc6_attr_if_parse(Ipdhcpc6_tagcomm_tag_t *tag,
Ip_u32 mask);
/*
*===========================================================================
* ipdhcpc6_attr_if_free
*===========================================================================
* Description: Free any resources previously allocated by parse. Will also
* free any ias
* Parameters: ifobjp - The interface object.
* Returns:
*
*/
IP_GLOBAL void ipdhcpc6_attr_if_free(Ipdhcpc6_attr_if_t **ifobjp);
/*
*===========================================================================
* ipdhcpc6_attr_if_automatic_parse
*===========================================================================
* Description: Parse an IPDHCPC6_IA_OBJECT_IF_AUTOMATIC tag.
* Parameters: tag - The tag.
* mask - The type of objects we'll parse; 0 = all.
* Returns: The interface config pointer
*
*/
IP_GLOBAL Ipdhcpc6_attr_if_automatic_t *ipdhcpc6_attr_if_automatic_parse(Ipdhcpc6_tagcomm_tag_t *tag,
Ip_u32 mask);
/*
*===========================================================================
* ipdhcpc6_attr_if_automatic_free
*===========================================================================
* Description: Free any resources previously allocated by parse.
* Parameters: ifautop - The interface automatic object.
* Returns:
*
*/
IP_GLOBAL void ipdhcpc6_attr_if_automatic_free(Ipdhcpc6_attr_if_automatic_t **ifautop);
/*
*===========================================================================
* ipdhcpc6_attr_if_config_parse
*===========================================================================
* Description: Parse an IPDHCPC6_IA_OBJECT_IF_CONFIG tag.
* Parameters: tag - The tag.
* mask - The type of objects we'll parse; 0 = all.
* Returns: The interface config pointer
*
*/
IP_GLOBAL Ipdhcpc6_attr_if_config_t *ipdhcpc6_attr_if_config_parse(Ipdhcpc6_tagcomm_tag_t *tag,
Ip_u32 mask);
/*
*===========================================================================
* ipdhcpc6_attr_if_config_free
*===========================================================================
* Description: Free any resources previously allocated by parse.
* Parameters: ifconfigp - The interface config object.
* Returns:
*
*/
IP_GLOBAL void ipdhcpc6_attr_if_config_free(Ipdhcpc6_attr_if_config_t **ifconfigp);
/*
*===========================================================================
* ipdhcpc6_attr_ia_parse
*===========================================================================
* Description: Parse an IPDHCPC6_ATTR_IA_IF_IA_OBJECT tag.
* Parameters: tag - The tag.
* mask - The type of objects we'll parse; 0 = all.
* Returns: The identity association pointer with its associated BINDINGS.
*
*/
IP_GLOBAL Ipdhcpc6_attr_ia_t *ipdhcpc6_attr_ia_parse(Ipdhcpc6_tagcomm_tag_t *tag,
Ip_u32 mask);
/*
*===========================================================================
* ipdhcpc6_attr_if_server_parse
*===========================================================================
* Description: Parse an IPDHCPC6_IA_OBJECT_SERVER tag.
* Parameters: tag - The tag.
* mask - The type of objects we'll parse; 0 = all.
* Returns: The interface server pointer
*
*/
IP_GLOBAL Ipdhcpc6_attr_if_server_t *ipdhcpc6_attr_if_server_parse(Ipdhcpc6_tagcomm_tag_t *tag,
Ip_u32 mask);
/*
*===========================================================================
* ipdhcpc6_attr_if_server_free
*===========================================================================
* Description: Free any resources previously allocated by parse.
* Parameters: ifsrvp - The interface server object.
* Returns:
*
*/
IP_GLOBAL void ipdhcpc6_attr_if_server_free(Ipdhcpc6_attr_if_server_t **ifsrvp);
/*
*===========================================================================
* ipdhcpc6_attr_ia_free
*===========================================================================
* Description: Free any resources previously allocated by parse. Will also
* free any bindings
* Parameters: iaobjp - The IA object.
* Returns:
*
*/
IP_GLOBAL void ipdhcpc6_attr_ia_free(Ipdhcpc6_attr_ia_t **iaobjp);
/*
*===========================================================================
* ipdhcpc6_attr_binding_parse
*===========================================================================
* Description: Parse an IPDHCPC6_IA_OBJECT_BINDING or
* IPDHCPC6_IA_OBJECT_BINDING_HINT tag.
* Parameters: tag - The tag.
* Returns: The binding object
*
*/
IP_GLOBAL Ipdhcpc6_attr_binding_t *ipdhcpc6_attr_binding_parse(Ipdhcpc6_tagcomm_tag_t *tag);
/*
*===========================================================================
* ipdhcpc6_attr_binding_free
*===========================================================================
* Description: Free any resources previously allocated by parse.
* Parameters: bobjp - The binding object.
* Returns:
*
*/
IP_GLOBAL void ipdhcpc6_attr_binding_free(Ipdhcpc6_attr_binding_t **bobjp);
/*===========================================================================
* ipdhcpc6_attr_connect
*===========================================================================
* Description: Create a TCP connection to the DHCPv6 Client
* Parameters:
* Returns: A file descriptor if successful, IP_INVALID_SOCKET otherwise.
*
*/
IP_GLOBAL Ip_fd ipdhcpc6_attr_connect(void);
/*
*===========================================================================
* ipdhcpc6_attr_errno
*===========================================================================
* Description: Return human readable string representation for error
* Parameters: errcode - The errcode
* Returns: The human readable string
*
*/
IP_GLOBAL const char *ipdhcpc6_attr_errno(Ip_u32 errcode);
/*
*===========================================================================
* ipdhcpc6_attr_sendmsg
*===========================================================================
* Description: Send a message over fd
* Parameters: fd - File descriptor.
* buf - Pointer to buffer.
* Returns: IP_TRUE if successful.
*
*/
IP_GLOBAL Ip_bool ipdhcpc6_attr_sendmsg(Ip_fd fd,
Ipdhcpc6_tagcomm_buffer_t *buf);
/*
*===========================================================================
* ipdhcpc6_attr_recvmsg
*===========================================================================
* Description: Read a message. A buffer holding the entire message will
* be dynamically allocated on success.
* Parameters: fd - File descriptor.
* rbuf - Pointer to buffer pointer. Will hold the
* dynamically allocated buffer on success.
* Returns: IP_TRUE if successful.
*
*/
IP_GLOBAL Ip_bool ipdhcpc6_attr_recvmsg(Ip_fd fd,
Ipdhcpc6_attr_readbuf_t *rbuf);
/*
*===========================================================================
* ipdhcpc6_attr_read
*===========================================================================
* Description: Read the number of bytes specified by rbuf
* Parameters: fd - The filedescriptor to read from
* rbuf - The read buffer
* block - Block until the entire command is read.
* Returns: The number of remaining bytes to read.
*
*/
IP_GLOBAL int ipdhcpc6_attr_read(Ip_fd fd,
Ipdhcpc6_attr_readbuf_t *rbuf,
Ip_bool block);
/*
*===========================================================================
* ipdhcpc6_attr_recvhdr
*===========================================================================
* Description: Read the header of a command, and allocate the required
* buffer space.
* Parameters: fd - File descriptor
* rbuf - Read buffer.
* Returns: IP_TRUE if successful.
*
*/
IP_GLOBAL Ip_bool ipdhcpc6_attr_recvhdr(Ip_fd fd,
Ipdhcpc6_attr_readbuf_t *rbuf);
/*
*===========================================================================
* ipdhcpc6_attr_ia_action
*===========================================================================
* Description: Return the human readable name of the action
* Parameters: action - The action
* Returns: The human readable name
*
*/
IP_GLOBAL const char *ipdhcpc6_attr_ia_action(Ip_u32 action);
/*
*===========================================================================
* ipdhcpc6_attr_ia_status
*===========================================================================
* Description: Return the human readable name of the status
* Parameters: status - The status
* Returns: The human readable name
*
*/
IP_GLOBAL const char *ipdhcpc6_attr_ia_status(Ip_u32 status);
/*
*===========================================================================
* ipdhcpc6_attr_array_add
*===========================================================================
* Description: Add an element to an array; allocate the array or increase
* it if required.
* Parameters: array - Pointer to the array
* object - Object
* size - Size of object; if zero, don't copy. Store as is.
* Returns:
*
*/
IP_GLOBAL void ipdhcpc6_attr_array_add(Ipdhcpc6_attr_array_t *array,
void *object,
Ip_size_t size);
/*
*===========================================================================
* ipdhcpc6_attr_array_free
*===========================================================================
* Description: Free the array and its elements.
* Parameters: array - The array
* freefunc - Option function to invoke per element.
* Returns:
*
*/
IP_GLOBAL void ipdhcpc6_attr_array_free(Ipdhcpc6_attr_array_t *array,
Ipdhcpc6_attr_array_free_t freefunc);
/*
*===========================================================================
* ipdhcpc6_attr_array_remove
*===========================================================================
* Description: Remove a particular element from the array
* Parameters: array - The array
* obj - The object
* freefunc - The free function.
* Returns:
*
*/
IP_GLOBAL void ipdhcpc6_attr_array_remove(Ipdhcpc6_attr_array_t *array,
void *obj,
Ipdhcpc6_attr_array_free_t freefunc);
/*
*===========================================================================
* ipdhcpc6_attr_server_set_unicast
*===========================================================================
* Description: Set a unicast address
* Parameters: srv - The server attributes
* addr - Address
* Returns:
*
*/
IP_GLOBAL void ipdhcpc6_attr_server_set_unicast(Ipdhcpc6_attr_if_server_t *srv,
const struct Ip_in6_addr *addr);
/*
*===========================================================================
* ipdhcpc6_attr_server_unicast
*===========================================================================
* Description: Returns the unicast address for a server
* Parameters: srv - The server attributes
* Returns: The unicast address if it exists.
*
*/
IP_GLOBAL const struct Ip_in6_addr *ipdhcpc6_attr_server_unicast(Ipdhcpc6_attr_if_server_t *srv);
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/