- refactored network
git-svn-id: http://moon:8086/svn/mips@204 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
// -------------------------------------------------------------------------
|
||||
// ipv4.h
|
||||
//
|
||||
// 21.12.2003, J. Ahrensfeld
|
||||
//
|
||||
// -------------------------------------------------------------------------
|
||||
#ifndef DHCP_H
|
||||
#define DHCP_H
|
||||
|
||||
#include "libsys.h"
|
||||
#include "ethernet.h"
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
typedef struct _sDHCP
|
||||
{
|
||||
uint8_t op, htype, hlen, hops;
|
||||
uint32_t xid;
|
||||
uint16_t secs, flags;
|
||||
uint8_t ciaddr[4];
|
||||
uint8_t yiaddr[4];
|
||||
uint8_t siaddr[4];
|
||||
uint8_t giaddr[4];
|
||||
uint8_t chaddr[16];
|
||||
uint8_t sname[64];
|
||||
uint8_t file[128];
|
||||
uint8_t options[312];
|
||||
|
||||
} __attribute__ ((__packed__)) DHCP;
|
||||
|
||||
|
||||
#define DHCP_BOOTREQUEST 1 // request.
|
||||
#define DHCP_BOOTREPLY 2 // reply.
|
||||
|
||||
typedef struct _sdhcp_opt_hdr_t
|
||||
{
|
||||
uint8_t code, len;
|
||||
|
||||
} __attribute__ ((__packed__)) dhcp_opt_hdr_t;
|
||||
|
||||
#define DHCP_OPT_HOSTNAME 12
|
||||
#define DHCP_OPT_REQIP 50
|
||||
#define DHCP_OPT_MSGTYPE 53
|
||||
#define DHCP_OPT_SERVERID 54
|
||||
#define DHCP_OPT_CLIENTID 61
|
||||
#define DHCP_OPT_END 255
|
||||
|
||||
#define DHCP_MSG_DHCPDISCOVER 1
|
||||
#define DHCP_MSG_DHCPOFFER 2
|
||||
#define DHCP_MSG_DHCPREQUEST 3
|
||||
#define DHCP_MSG_DHCPDECLINE 4
|
||||
#define DHCP_MSG_DHCPACK 5
|
||||
#define DHCP_MSG_DHCPNAK 6
|
||||
#define DHCP_MSG_DHCPRELEASE 7
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
void DHCP_request_send(packet_t *pPacket, uint32_t dhcp_msg_type, uint8_t *mac_addr_src, uint8_t *inet_addr_src, uint8_t *inet_addr_dst, DHCP *pLast);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
#endif // DHCP_H
|
||||
Reference in New Issue
Block a user