File: cdpr.h

package info (click to toggle)
cdpr 2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 264 kB
  • sloc: ansic: 1,074; perl: 72; makefile: 23; php: 23
file content (67 lines) | stat: -rw-r--r-- 1,729 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* cdpr - Cisco Discovery Protocol Reporter
* Copyright (c) 2002-2010 MonkeyMental.com
*
* This program will show you which Cisco device your machine is
* connected to based on CDP packets received.
*
* 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#ifndef CDPR_H
#define CDPR_H

/*
** Includes
*/
#include "pcap.h"

/*
** Defines
*/
#define CDPRS_INIT 1
#define CDPRS_SETIP 2
#define CDPRS_SETPORT 3
#define CDPRS_DATA 4
#define CDPRS_SEND 5

struct singleton
{
	struct pcap_pkthdr *hdr;
	const u_char *pkt;
};

/*
** Global variables
*/
int timeout;
int cdprs;
pcap_t *handle;

/*
** Function Prototypes
*/
int	cdprs_action(int action, char *string, int verbose);
void set_location(char *loc);
void get_hostname(int nameoverride, char *name);
void read_file(char *file);
char * urlencode(char *s, int slen, int *new_len);
int enable_timeout(void);
int set_timeout(unsigned int seconds);
const u_char * pkt_next(pcap_t *p, struct pcap_pkthdr *h);
void do_something_with(char *ip, char *url);


#endif