SayoriOS 0.3.3

dhcp.h
1 #pragma once
2
3 #include "common.h"
4
5 #define DHCP_REQUEST 1
6 #define DHCP_REPLY 2
7
8 typedef struct dhcp_packet {
9 uint8_t op;
10 uint8_t hardware_type;
11 uint8_t hardware_addr_len;
12 uint8_t hops;
13 uint32_t xid;
14 uint16_t seconds;
15 uint16_t flags;
16 uint32_t client_ip;
17 uint32_t your_ip;
18 uint32_t server_ip;
19 uint32_t gateway_ip;
20 uint8_t client_hardware_addr[16];
21 uint8_t server_name[64];
22 uint8_t file[128];
23 uint8_t options[340];
24 } __attribute__ ((packed)) dhcp_packet_t;
25
26 void dhcp_discover(netcard_entry_t* card);
27 void dhcp_handle_packet(netcard_entry_t* card, dhcp_packet_t* packet);
28 void dhcp_request(netcard_entry_t* card, const uint8_t req_ip[4]);
29 void dhcp_init_all_cards();
common.h
Основные определения ядра
__attribute__
struct registers __attribute__((packed))
Структура данных пакета от мыши
Definition: psf.h:19
dhcp_packet
Definition: dhcp.h:8
netcard_entry_t
Definition: cards.h:5