~ubuntu-branches/ubuntu/trusty/xprobe/trusty

« back to all changes in this revision

Viewing changes to src/xpmodules/modules_proto/test_mod.cc

  • Committer: Bazaar Package Importer
  • Author(s): Richard Atterer
  • Date: 2005-02-22 22:54:24 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050222225424-6cqy8rr45pkna819
Tags: 0.2.2-1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: test_mod.cc,v 1.2 2003/04/22 20:00:51 fygrave Exp $ */
 
2
/*
 
3
** Copyright (C) 2001 Fyodor Yarochkin <fygrave@tigerteam.net>,
 
4
**                    Ofir Arkin       <ofir@sys-security.com>
 
5
**
 
6
** This program is free software; you can redistribute it and/or modify
 
7
** it under the terms of the GNU General Public License as published by
 
8
** the Free Software Foundation; either version 2 of the License, or
 
9
** (at your option) any later version.
 
10
**
 
11
**
 
12
** This program is distributed in the hope that it will be useful,
 
13
** but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
** GNU General Public License for more details.
 
16
**
 
17
** You should have received a copy of the GNU General Public License
 
18
** along with this program; if not, write to the Free Software
 
19
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
*/
 
21
 
 
22
#include "xprobe.h"
 
23
#define _XPROBE_MODULE
 
24
#include "xplib.h"
 
25
#include "xprobe_module.h"
 
26
#include "xprobe_module_hdlr.h"
 
27
#include "target.h"
 
28
#include "interface.h"
 
29
#include "test_mod.h"
 
30
 
 
31
extern Interface *ui;
 
32
 
 
33
 
 
34
 
 
35
int Test_Mod::init(void) {
 
36
 
 
37
    xprobe_debug(XPROBE_DEBUG_MODULES, "%s module initialized\n", get_name());
 
38
    return OK;
 
39
}
 
40
 
 
41
 
 
42
int Test_Mod::exec(Target *tg, OS_Matrix *os) {
 
43
    xprobe_debug(XPROBE_DEBUG_MODULES, "--%s module has been executed against: %s\n", get_name(),
 
44
            inet_ntoa(tg->get_addr()));
 
45
    os->add_result(get_id(), 1, XPROBE_MATCH_YES);
 
46
    return OK;
 
47
}
 
48
 
 
49
int Test_Mod::fini(void) {
 
50
    xprobe_debug(XPROBE_DEBUG_MODULES, "%s module has been deinitilized\n", get_name());
 
51
    return OK;
 
52
}
 
53
 
 
54
int Test_Mod::parse_keyword(int os_id, char *kwd, char *val)  {
 
55
    
 
56
    xprobe_debug(XPROBE_DEBUG_MODULES, "Parsing for %i : %s  = %s\n",
 
57
                                                        os_id,  kwd, val);
 
58
    return OK;
 
59
};
 
60
 
 
61
/* initialization function */
 
62
 
 
63
int test_mod_init(Xprobe_Module_Hdlr *pt) {
 
64
 
 
65
    Test_Mod *test_mod = new Test_Mod;
 
66
 
 
67
    xprobe_mdebug(XPROBE_DEBUG_MODULES, "Initializing the test module\n");
 
68
    pt->register_module(test_mod);
 
69
 
 
70
return OK;
 
71
}
 
72
 
 
73