| [3321] | 1 | /* |
|---|
| 2 | * pxe-pdhcp |
|---|
| 3 | * |
|---|
| 4 | * Copyright (c) 2007 FURUHASHI Sadayuki <fr _at_ syuki.skr.jp> |
|---|
| 5 | * |
|---|
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
|---|
| 7 | * of this software and associated documentation files (the "Software"), to deal |
|---|
| 8 | * in the Software without restriction, including without limitation the rights |
|---|
| 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|---|
| 10 | * copies of the Software, and to permit persons to whom the Software is |
|---|
| 11 | * furnished to do so, subject to the following conditions: |
|---|
| 12 | * |
|---|
| 13 | * The above copyright notice and this permission notice shall be included in |
|---|
| 14 | * all copies or substantial portions of the Software. |
|---|
| 15 | * |
|---|
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|---|
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|---|
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|---|
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|---|
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|---|
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|---|
| 22 | * THE SOFTWARE. |
|---|
| 23 | */ |
|---|
| 24 | |
|---|
| 25 | #ifndef PXE_PDHCP_H |
|---|
| 26 | #define PXE_PDHCP_H 1 |
|---|
| 27 | |
|---|
| 28 | #include <sys/types.h> |
|---|
| 29 | #include <arpa/inet.h> |
|---|
| 30 | #include "dhcp.h" |
|---|
| 31 | |
|---|
| 32 | #define DHCP_SERVER_PORT 67 |
|---|
| 33 | #define DHCP_CLIENT_PORT 68 |
|---|
| 34 | |
|---|
| 35 | #define DHCP_OPTIONS_COOKIE_LEN 4 |
|---|
| 36 | |
|---|
| 37 | #define PXE_IDENTIFIER_STRING "PXEClient" |
|---|
| 38 | |
|---|
| 39 | #define PXE_MTFTP_IP 1 |
|---|
| 40 | #define PXE_MTFTP_CPORT 2 |
|---|
| 41 | #define PXE_MTFTP_SPORT 3 |
|---|
| 42 | #define PXE_MTFTP_TMOUT 4 |
|---|
| 43 | #define PXE_MTFTP_DELAY 5 |
|---|
| 44 | #define PXE_DISCOVERY_CONTROL 6 |
|---|
| 45 | #define PXE_DISCOVERY_MCAST_ADDR 7 |
|---|
| 46 | #define PXE_BOOT_SERVERS 8 |
|---|
| 47 | #define PXE_BOOT_MENU 9 |
|---|
| 48 | #define PXE_MENU_PROMPT 10 |
|---|
| 49 | #define PXE_MCAST_ADDRS_ALLOC 11 |
|---|
| 50 | #define PXE_CREDENTIAL_TYPES 12 |
|---|
| 51 | #define PXE_END 255 |
|---|
| 52 | |
|---|
| 53 | #define PXE_DISCOVERY_CONTROL_BIT0 0x01 |
|---|
| 54 | #define PXE_DISCOVERY_CONTROL_BIT1 0x02 |
|---|
| 55 | #define PXE_DISCOVERY_CONTROL_BIT2 0x04 |
|---|
| 56 | #define PXE_DISCOVERY_CONTROL_BIT3 0x08 |
|---|
| 57 | |
|---|
| 58 | int check_dhcp_packet(struct dhcp_packet *p); |
|---|
| 59 | int get_dhcp_option(struct dhcp_packet *p, u_char type, |
|---|
| 60 | u_char **opt, u_char *optlen); |
|---|
| 61 | int get_dhcp_message_type(struct dhcp_packet *p); |
|---|
| 62 | int get_dhcp_packet_len(struct dhcp_packet *p); |
|---|
| 63 | int add_dhcp_option(struct dhcp_packet *p, u_char type, |
|---|
| 64 | u_char *opt, u_char optlen); |
|---|
| 65 | |
|---|
| 66 | #endif |
|---|
| 67 | |
|---|