File: report.h

package info (click to toggle)
libsnsp 0.0.5-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 632 kB
  • ctags: 182
  • sloc: sh: 7,705; ansic: 1,049; makefile: 57
file content (67 lines) | stat: -rw-r--r-- 2,224 bytes parent folder | download
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
/*
    LIBSNSP - A C Library for the Simple Network Scanning Protocol
    Copyright (C) 2001 Michael R. K´┐Żllejan 

    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
*/

/* $Id: report.h,v 1.2 2001/10/03 22:41:18 michael Exp $ */

#ifndef REPORT_H
#define REPORT_H 1

#include <libxml/tree.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>

#include "linkedlist.h"
#include "cmdport.h"

typedef struct snsp_report snsp_report_t;
typedef struct snsp_report_host	snsp_report_host_t;
typedef struct snsp_report_port	snsp_report_port_t;

struct snsp_report {
	LINKED_LIST_T(snsp_report_host_t*)	*hosts;
};

struct snsp_report_host {
	char	  			                      *address;
	char  				                      *scantype;
	LINKED_LIST_T(snsp_report_port_t*)	*ports;
};

typedef enum {
	snsp_report_port_status_open = 0,
	snsp_report_port_status_closed,
	snsp_report_port_status_notscanned,
  snsp_report_port_status_filtered
} snsp_report_port_status_t;

struct snsp_report_port {
	snsp_report_port_status_t	             status;
	LINKED_LIST_T(snsp_portrange_t*)       *portlist;
};

snsp_report_t* snsp_report_alloc ();
void snsp_report_free ( snsp_report_t **report );
snsp_report_port_t* snsp_report_port_alloc ();
void snsp_report_port_free ( snsp_report_port_t **port );
snsp_report_host_t* snsp_report_host_alloc ();
void snsp_report_host_free ( snsp_report_host_t **host );
char* snsp_report_render ( snsp_report_t *report );
void* snsp_report_shrink ( snsp_report_t *report );
snsp_report_t* snsp_report_parse ( char* );
#endif /* REPORT_H */