📄 arp_48bit.h
字号:
/* This file is part of sniffer, a packet capture utility and network moniter The author can be contacted at <mistral@stev.org> the lastest version is avilable from http://stev.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#ifndef _SNIFF_ARP_48bit_H#define _SNIFF_ARP_48bit_H#ifdef ARP_48BIT#include <sys/socket.h>#include <sys/types.h>#include <linux/in.h>#include <linux/if.h>#include <linux/if_arp.h>#include "sniff.h"#include "list.h"#include "arp.h"#include "gui_main.h"/* this is for the incoming data */struct arp_48bit { unsigned char shw[ETH_ALEN]; /* sender hardware */ unsigned char sip[4]; /* sender ip */ unsigned char rhw[ETH_ALEN]; /* reciver hardware */ unsigned char rip[4]; /* reciver ip */};struct arp_48bit_vendor { unsigned char hw[ETH_ALEN]; char *string;};struct arp_48bit_data_t { char *str_addr; /* string ip address */ char *str_name; /* hostname string */ char *str_vendor; /* vendor string */ int if_index; /* index number */ char *if_name; /* if name */ unsigned char hw[ETH_ALEN]; /* the hardware address */ unsigned long ip; /* binary ip address */ time_t last; /* the last time it was seen */ unsigned char first:1, /* is this the first request */ res:7; /* just to make up the rest of the byte */};/******* VARS ******/extern pthread_mutex_t arp_48bit_mutex;extern struct list_t *arp_48bit_ven;extern struct list_t *arp_48bit_data;extern struct arp_48bit_vendor arp_48bit_vendors[];extern unsigned long long arp_48bit_stats_requests;extern unsigned long long arp_48bit_stats_replies;extern unsigned long long arp_48bit_stats_dropped;extern unsigned long long arp_48bit_stats_errors;/**** Fucntions *****/extern int arp_handle_48bit (struct sniff_pkt *pkt, struct arphdr *in, void *data);extern inline int arp_48bit_reply (struct sniff_pkt *pkt, struct arp_48bit *packet);extern inline int arp_48bit_request (struct sniff_pkt *pkt, struct arp_48bit *packet);extern int arp_48bit_cmp_ip (struct arp_48bit_data_t *c1, struct arp_48bit_data_t *c2);extern void arp_48bit_set_vendor (struct arp_48bit_data_t *data);extern int arp_48bit_cmp_vendors (struct arp_48bit_vendor *c1, struct arp_48bit_vendor *c2);extern int arp_48bit_init ( void ); /* only call at startup */extern void arp_gui_48bit (struct gui_t *p, int y, int x);#endif /* do we want arp_48bit ? */#endif /* _SNIFF_ARP_48bit_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -