00001 00002 //*************************************************************************** 00003 //* arp.h 00004 //* 00005 //* Mon Aug 28 22:31:14 2006 00006 //* Copyright 2006 sharandac 00007 //* Email sharandac(at)snafu.de 00008 //****************************************************************************/ 00011 //****************************************************************************/ 00012 /* 00013 * This program is free software; you can redistribute it and/or modify 00014 * it under the terms of the GNU General Public License as published by 00015 * the Free Software Foundation; either version 2 of the License, or 00016 * (at your option) any later version. 00017 * 00018 * This program is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public License 00024 * along with this program; if not, write to the Free Software 00025 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00026 */ 00028 #ifndef __ARP_H__ 00029 00030 #define __ARP_H__ 00031 00032 extern void arp( unsigned int packet_lenght, unsigned char *buffer); 00033 unsigned int GetIP2MAC( unsigned long IP, unsigned char * MACbuffer ); 00034 00035 #define MAX_ARPTABLE_ENTRYS 1 00036 00037 #define ARP_ANSWER 0 00038 #define NO_ARP_ANSWER !ARP_ANSWER 00039 00040 struct ARP_TABLE { 00041 unsigned long IP; 00042 unsigned char MAC[6]; 00043 }; 00044 00045 #define ARP_HEADER_LENGHT 28 00046 00047 struct ARP_header { 00048 unsigned int HWtype; // 2 Byte 00049 unsigned int Protocoltype; // 2 Byte 00050 unsigned char HWsize; // 1 Byte 00051 unsigned char Protocolsize; // 1 Byte 00052 unsigned int ARP_Opcode; // 2 Byte 00053 unsigned char ARP_sourceMac[6]; // 6 Byte 00054 unsigned long ARP_sourceIP; // 4 Byte 00055 unsigned char ARP_destMac[6]; // 6 Byte 00056 unsigned long ARP_destIP; // 4 Byte = 28 00057 }; 00058 00059 #endif