Recherche pcap.h

Forum sur la sécurité des réseaux, la configuration des firewalls, la mise en place de protections contre les attaques, de DMZ, de systèmes anti-intrusion ...

Modérateur: modos Ixus

Messagepar fafet » 18 Août 2003 16:37

Salut, <BR> <BR>Je suis à la recherche de la librairie contenant pcap.h vu que le site de tcpdump est inaccessible, je voulais savoir si quelqu'un pouvait m'envoyer le .tar.gz ... <BR> <BR>Merci <BR> <BR>fafet
... le désordre, c'est l'ordre sans le pouvoir ... (Léo Ferré)
Avatar de l’utilisateur
fafet
Second Maître
Second Maître
 
Messages: 37
Inscrit le: 11 Juin 2003 00:00
Localisation: Lorraine - France

Messagepar wann » 18 Août 2003 18:43

C'est un fichier header que tu trouveras dans un paquet du nom de libpcap (+ ou - selon ta distribution). Il te suffit de l'installer, et hop ! <BR>
"Free your mind and your ass wil follow" (George Clinton)
Avatar de l’utilisateur
wann
Amiral
Amiral
 
Messages: 1032
Inscrit le: 07 Jan 2002 01:00
Localisation: Nantais, parfois ;-)

Messagepar fafet » 18 Août 2003 20:39

Le prob c'est que pour avoir le paquet, et bien tout le monde m'envoie sur tcpdump.org et que j'arrive pas à y avoir accès, donc si quelqu'un a le paquet, je désirerais qu'on me l'envoie <IMG SRC="images/smiles/icon_smile.gif"> <BR> <BR>fafet
... le désordre, c'est l'ordre sans le pouvoir ... (Léo Ferré)
Avatar de l’utilisateur
fafet
Second Maître
Second Maître
 
Messages: 37
Inscrit le: 11 Juin 2003 00:00
Localisation: Lorraine - France

Messagepar tomtom » 18 Août 2003 20:55

[root@lnx_delb root]# vi /usr/include/pcap.h <BR> <BR>/* -*- Mode: c; tab-width: 8; indent-tabs-mode: 1; c-basic-offset: 8; -*- */ <BR>/* <BR> * Copyright (c) 1993, 1994, 1995, 1996, 1997 <BR> * The Regents of the University of California. All rights reserved. <BR> * <BR> * Redistribution and use in source and binary forms, with or without <BR> * modification, are permitted provided that the following conditions <BR> * are met: <BR> * 1. Redistributions of source code must retain the above copyright <BR> * notice, this list of conditions and the following disclaimer. <BR> * 2. Redistributions in binary form must reproduce the above copyright <BR> * notice, this list of conditions and the following disclaimer in the <BR> * documentation and/or other materials provided with the distribution. <BR> * 3. All advertising materials mentioning features or use of this software <BR> * must display the following acknowledgement: <BR> * This product includes software developed by the Computer Systems <BR> * Engineering Group at Lawrence Berkeley Laboratory. <BR> * 4. Neither the name of the University nor of the Laboratory may be used <BR> * to endorse or promote products derived from this software without <BR> * specific prior written permission. <BR> * <BR> * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND <BR> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE <BR> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE <BR> * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE <BR> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL <BR> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS <BR> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) <BR> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT <BR> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY <BR> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF <BR> * SUCH DAMAGE. <BR> * <BR> * @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.34 2001/12/09 05:10:03 guy Exp $ (LBL) <BR> */ <BR> <BR>#ifndef lib_pcap_h <BR>#define lib_pcap_h <BR> <BR>#include <sys/types.h> <BR>#include <sys/time.h> <BR> <BR>#include <net/bpf.h> <BR> <BR>#include <stdio.h> <BR> <BR>#ifdef __cplusplus <BR>extern "C" { <BR>#endif <BR> <BR>#define PCAP_VERSION_MAJOR 2 <BR>#define PCAP_VERSION_MINOR 4 <BR> <BR>#define PCAP_ERRBUF_SIZE 256 <BR> <BR>/* <BR> * Compatibility for systems that have a bpf.h that <BR> * predates the bpf typedefs for 64-bit support. <BR> */ <BR>#if BPF_RELEASE - 0 < 199406 <BR>typedef int bpf_int32; <BR>typedef u_int bpf_u_int32; <BR>#endif <BR> <BR>typedef struct pcap pcap_t; <BR>typedef struct pcap_dumper pcap_dumper_t; <BR>typedef struct pcap_if pcap_if_t; <BR>typedef struct pcap_addr pcap_addr_t; <BR> <BR>/* <BR> * The first record in the file contains saved values for some <BR> * of the flags used in the printout phases of tcpdump. <BR> * Many fields here are 32 bit ints so compilers won't insert unwanted <BR> * padding; these files need to be interchangeable across architectures. <BR> * <BR> * Do not change the layout of this structure, in any way (this includes <BR> * changes that only affect the length of fields in this structure). <BR> * <BR> * Also, do not change the interpretation of any of the members of this <BR> * structure, in any way (this includes using values other than <BR> * LINKTYPE_ values, as defined in "savefile.c", in the "linktype" <BR> * field). <BR> * <BR> * Instead: <BR> * <BR> * introduce a new structure for the new format, if the layout <BR> * of the structure changed; <BR> * <BR> * send mail to "tcpdump-workers@tcpdump.org", requesting a new <BR> * magic number for your new capture file format, and, when <BR> * you get the new magic number, put it in "savefile.c"; <BR> * <BR> * use that magic number for save files with the changed file <BR> * header; <BR> * <BR> * make the code in "savefile.c" capable of reading files with <BR> * the old file header as well as files with the new file header <BR> * (using the magic number to determine the header format). <BR> * <BR> * Then supply the changes to "patches@tcpdump.org", so that future <BR> * versions of libpcap and programs that use it (such as tcpdump) will <BR> * be able to read your new capture file format. <BR> */ <BR>struct pcap_file_header { <BR> bpf_u_int32 magic; <BR> u_short version_major; <BR> u_short version_minor; <BR> bpf_int32 thiszone; /* gmt to local correction */ <BR> bpf_u_int32 sigfigs; /* accuracy of timestamps */ <BR> bpf_u_int32 snaplen; /* max length saved portion of each pkt */ <BR> bpf_u_int32 linktype; /* data link type (LINKTYPE_*) */ <BR>}; <BR> <BR>/* <BR> * Each packet in the dump file is prepended with this generic header. <BR> * This gets around the problem of different headers for different <BR> * packet interfaces. <BR> */ <BR>struct pcap_pkthdr { <BR> struct timeval ts; /* time stamp */ <BR> bpf_u_int32 caplen; /* length of portion present */ <BR> bpf_u_int32 len; /* length this packet (off wire) */ <BR>}; <BR> <BR>/* <BR> * As returned by the pcap_stats() <BR> */ <BR>struct pcap_stat { <BR> u_int ps_recv; /* number of packets received */ <BR> u_int ps_drop; /* number of packets dropped */ <BR> u_int ps_ifdrop; /* drops by interface XXX not yet supported */ <BR>}; <BR> <BR>/* <BR> * Item in a list of interfaces. <BR> */ <BR>struct pcap_if { <BR> struct pcap_if *next; <BR> char *name; /* name to hand to "pcap_open_live()" */ <BR> char *description; /* textual description of interface, or NULL */ <BR> struct pcap_addr *addresses; <BR> u_int flags; /* PCAP_IF_ interface flags */ <BR>}; <BR> <BR>#define PCAP_IF_LOOPBACK 0x00000001 /* interface is loopback */ <BR> <BR>/* <BR> * Representation of an interface address. <BR> */ <BR>struct pcap_addr { <BR> struct pcap_addr *next; <BR> struct sockaddr *addr; /* address */ <BR> struct sockaddr *netmask; /* netmask for that address */ <BR> struct sockaddr *broadaddr; /* broadcast address for that address */ <BR> struct sockaddr *dstaddr; /* P2P destination address for that address */ <BR>}; <BR> <BR>typedef void (*pcap_handler)(u_char *, const struct pcap_pkthdr *, <BR> const u_char *); <BR> <BR>char *pcap_lookupdev(char *); <BR>int pcap_lookupnet(char *, bpf_u_int32 *, bpf_u_int32 *, char *); <BR>pcap_t *pcap_open_live(char *, int, int, int, char *); <BR>pcap_t *pcap_open_dead(int, int); <BR>pcap_t *pcap_open_offline(const char *, char *); <BR>void pcap_close(pcap_t *); <BR>int pcap_loop(pcap_t *, int, pcap_handler, u_char *); <BR>int pcap_dispatch(pcap_t *, int, pcap_handler, u_char *); <BR>const u_char* <BR> pcap_next(pcap_t *, struct pcap_pkthdr *); <BR>int pcap_stats(pcap_t *, struct pcap_stat *); <BR>int pcap_setfilter(pcap_t *, struct bpf_program *); <BR>int pcap_getnonblock(pcap_t *, char *); <BR>int pcap_setnonblock(pcap_t *, int, char *); <BR>void pcap_perror(pcap_t *, char *); <BR>char *pcap_strerror(int); <BR>char *pcap_geterr(pcap_t *); <BR>int pcap_compile(pcap_t *, struct bpf_program *, char *, int, <BR> bpf_u_int32); <BR>int pcap_compile_nopcap(int, int, struct bpf_program *, <BR> char *, int, bpf_u_int32); <BR>void pcap_freecode(struct bpf_program *); <BR>int pcap_datalink(pcap_t *); <BR>int pcap_snapshot(pcap_t *); <BR>int pcap_is_swapped(pcap_t *); <BR>int pcap_major_version(pcap_t *); <BR>int pcap_minor_version(pcap_t *); <BR> <BR>/* XXX */ <BR>FILE *pcap_file(pcap_t *); <BR>int pcap_fileno(pcap_t *); <BR> <BR>pcap_dumper_t *pcap_dump_open(pcap_t *, const char *); <BR>void pcap_dump_close(pcap_dumper_t *); <BR>void pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *); <BR> <BR>int pcap_findalldevs(pcap_if_t **, char *); <BR>void pcap_freealldevs(pcap_if_t *); <BR> <BR>/* XXX this guy lives in the bpf tree */ <BR>u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); <BR>int bpf_validate(struct bpf_insn *f, int len); <BR>char *bpf_image(struct bpf_insn *, int); <BR>void bpf_dump(struct bpf_program *, int); <BR> <BR>#ifdef __cplusplus <BR>} <BR>#endif <BR> <BR>#endif
One hundred thousand lemmings can't be wrong...
Avatar de l’utilisateur
tomtom
Amiral
Amiral
 
Messages: 6035
Inscrit le: 26 Avr 2002 00:00
Localisation: Paris

Messagepar fafet » 19 Août 2003 00:16

Je l'attendais pas comme ça, mais ça m'ira ...merci Tomtom <BR> <BR>Emmanuel
... le désordre, c'est l'ordre sans le pouvoir ... (Léo Ferré)
Avatar de l’utilisateur
fafet
Second Maître
Second Maître
 
Messages: 37
Inscrit le: 11 Juin 2003 00:00
Localisation: Lorraine - France

Messagepar tomtom » 19 Août 2003 09:18

Je me doute <IMG SRC="images/smiles/icon_wink.gif"> <BR> <BR>Mais je n'avais pas de mail ni autres pour te l'envoyer.. Alors comme c'est du texte, hein ... <IMG SRC="images/smiles/icon_bise.gif"> <BR> <BR>T.
One hundred thousand lemmings can't be wrong...
Avatar de l’utilisateur
tomtom
Amiral
Amiral
 
Messages: 6035
Inscrit le: 26 Avr 2002 00:00
Localisation: Paris


Retour vers Sécurité et réseaux

Qui est en ligne ?

Utilisateur(s) parcourant actuellement ce forum : Aucun utilisateur inscrit et 1 invité

cron