Untabify and reindent packet.h.

This commit is contained in:
Nicholas J. Kain 2010-11-14 00:54:05 -05:00
parent 6a3b004eee
commit 0661f4371b

View File

@ -5,36 +5,36 @@
#include <netinet/ip.h> #include <netinet/ip.h>
struct dhcpMessage { struct dhcpMessage {
uint8_t op; uint8_t op;
uint8_t htype; uint8_t htype;
uint8_t hlen; uint8_t hlen;
uint8_t hops; uint8_t hops;
uint32_t xid; uint32_t xid;
uint16_t secs; uint16_t secs;
uint16_t flags; uint16_t flags;
uint32_t ciaddr; uint32_t ciaddr;
uint32_t yiaddr; uint32_t yiaddr;
uint32_t siaddr; uint32_t siaddr;
uint32_t giaddr; uint32_t giaddr;
uint8_t chaddr[16]; uint8_t chaddr[16];
uint8_t sname[64]; uint8_t sname[64];
uint8_t file[128]; uint8_t file[128];
uint32_t cookie; uint32_t cookie;
uint8_t options[308]; /* 312 - cookie */ uint8_t options[308]; /* 312 - cookie */
}; };
struct udp_dhcp_packet { struct udp_dhcp_packet {
struct iphdr ip; struct iphdr ip;
struct udphdr udp; struct udphdr udp;
struct dhcpMessage data; struct dhcpMessage data;
}; };
int get_packet(struct dhcpMessage *packet, int fd); int get_packet(struct dhcpMessage *packet, int fd);
uint16_t checksum(void *addr, int count); uint16_t checksum(void *addr, int count);
int raw_packet(struct dhcpMessage *payload, uint32_t source_ip, int source_port, int raw_packet(struct dhcpMessage *payload, uint32_t source_ip,
uint32_t dest_ip, int dest_port, unsigned char *dest_arp, int ifindex); int source_port, uint32_t dest_ip, int dest_port,
int kernel_packet(struct dhcpMessage *payload, uint32_t source_ip, int source_port, unsigned char *dest_arp, int ifindex);
uint32_t dest_ip, int dest_port); int kernel_packet(struct dhcpMessage *payload, uint32_t source_ip,
int source_port, uint32_t dest_ip, int dest_port);
#endif #endif