added some dhcp6 definitions

This commit is contained in:
hyung-hwan 2021-08-13 15:47:17 +00:00
parent 0ae736ebb0
commit 4169ef924b
2 changed files with 74 additions and 2 deletions

View File

@ -22,6 +22,7 @@
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <hio-dhcp.h>
#include <hio-sck.h> #include <hio-sck.h>
#include "hio-prv.h" #include "hio-prv.h"

View File

@ -28,7 +28,75 @@
#include <hio.h> #include <hio.h>
#include <hio-skad.h> #include <hio-skad.h>
#define HIO_DNS_PORT (53) #define HIO_DHCP6_SERVER_PORT (547)
#define HIO_DHCP6_CLIENT_PORT (546)
#define HIO_DHCP6_HOP_COUNT_LIMIT (32)
enum hio_dhcp6_msg_t
{
HIO_DHCP6_MSG_SOLICIT = 1,
HIO_DHCP6_MSG_ADVERTISE = 2,
HIO_DHCP6_MSG_REQUEST = 3,
HIO_DHCP6_MSG_CONFIRM = 4,
HIO_DHCP6_MSG_RENEW = 5,
HIO_DHCP6_MSG_REBIND = 6,
HIO_DHCP6_MSG_REPLY = 7,
HIO_DHCP6_MSG_RELEASE = 8,
HIO_DHCP6_MSG_DECLINE = 9,
HIO_DHCP6_MSG_RECONFIGURE = 10,
HIO_DHCP6_MSG_INFOREQ = 11,
HIO_DHCP6_MSG_RELAYFORW = 12,
HIO_DHCP6_MSG_RELAYREPL = 13,
};
typedef enum hio_dhcp6_msg_t hio_dhcp6_msg_t;
enum hio_dhcp6_opt_t
{
HIO_DHCP6_OPT_RELAY_MESSAGE = 9,
HIO_DHCP6_OPT_INTERFACE_ID = 18
};
typedef enum hio_dhcp6_opt_t hio_dhcp6_opt_t;
/* ---------------------------------------------------------------- */
#include <hio-pac1.h>
struct hio_dhcp6_pkt_hdr_t
{
hio_uint8_t msgtype;
hio_uint8_t transid[3];
};
typedef struct hio_dhcp6_pkt_hdr_t hio_dhcp6_pkt_hdr_t;
struct hio_dhcp6_relay_hdr_t
{
hio_uint8_t msgtype; /* RELAY-FORW, RELAY-REPL */
hio_uint8_t hopcount;
hio_uint8_t linkaddr[16];
hio_uint8_t peeraddr[16];
};
typedef struct hio_dhcp6_relay_hdr_t hio_dhcp6_relay_hdr_t;
struct hio_dhcp6_opt_hdr_t
{
hio_uint16_t code;
hio_uint16_t len; /* length of option data, excludes the option header */
};
typedef struct hio_dhcp6_opt_hdr_t hio_dhcp6_opt_hdr_t;
#include <hio-upac.h>
struct hio_dhcp6_pktinf_t
{
hio_dhcp6_pkt_hdr_t* hdr;
hio_oow_t len;
};
typedef struct hio_dhcp6_pktinf_t hio_dhcp6_pktinf_t;
/* ---------------------------------------------------------------- */
typedef struct hio_svc_dhcs_t hio_svc_dhcs_t; typedef struct hio_svc_dhcs_t hio_svc_dhcs_t;
@ -39,12 +107,15 @@ extern "C" {
#endif #endif
HIO_EXPORT hio_svc_dhcs_t* hio_svc_dhcs_start ( HIO_EXPORT hio_svc_dhcs_t* hio_svc_dhcs_start (
hio_t* hio, hio_t* hio
#if 0
,
const hio_skad_t* serv_addr, /* required */ const hio_skad_t* serv_addr, /* required */
const hio_skad_t* bind_addr, /* optional. can be HIO_NULL */ const hio_skad_t* bind_addr, /* optional. can be HIO_NULL */
const hio_ntime_t* send_tmout, /* required */ const hio_ntime_t* send_tmout, /* required */
const hio_ntime_t* reply_tmout, /* required */ const hio_ntime_t* reply_tmout, /* required */
hio_oow_t max_tries /* required */ hio_oow_t max_tries /* required */
#endif
); );
HIO_EXPORT void hio_svc_dhcs_stop ( HIO_EXPORT void hio_svc_dhcs_stop (