~ubuntu-branches/ubuntu/natty/ntop/natty

« back to all changes in this revision

Viewing changes to ntop/intop/status.c

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2005-01-30 21:59:13 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050130215913-xc3ke963bw49b3k4
Tags: 2:3.0-5
* Updated README.Debian file so users will understand what to do at
  install, closes: #291794, #287802.
* Updated ntop init script to give better output.
* Also changed log directory from /var/lib/ntop to /var/log/ntop,
  closes: #252352.
* Quoted the interface list to allow whitespace, closes: #267248.
* Added a couple of logcheck ignores, closes: #269321, #269319.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3
 
 * status.c - Tell status information.
4
 
 *
5
 
 * Luca Deri     <deri@ntop.org>
6
 
 * Rocco Carbone <rocco@ntop.org>
7
 
 * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
8
 
 *
9
 
 * This program is free software; you can redistribute it and/or modify
10
 
 * it under the terms of the GNU General Public License as published by
11
 
 * the Free Software Foundation; either version 2 of the License, or
12
 
 * (at your option) any later version.
13
 
 *
14
 
 * This program is distributed in the hope that it will be useful,
15
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
 * GNU General Public License for more details.
18
 
 *
19
 
 * You should have received a copy of the GNU General Public License
20
 
 * along with this program; if not, write to the Free Software
21
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
 
 */
23
 
 
24
 
 
25
 
/*
26
 
 * ntop header file(s)
27
 
 */
28
 
#include "ntop.h"
29
 
 
30
 
/*
31
 
 * Tell status information.
32
 
 */
33
 
int intop_status (int argc, char * argv [])
34
 
{
35
 
  /*
36
 
   * Notice the command name.
37
 
   */
38
 
  char * commandname = argv [0];
39
 
 
40
 
  int c;
41
 
#define USAGE(xxx) \
42
 
  printf ("Usage: %s [-h]\n\
43
 
           \n", xxx)
44
 
  char * optstring = "h";
45
 
 
46
 
  /*
47
 
   * Reserve here space for the local variables.
48
 
   */
49
 
 
50
 
 
51
 
  optind = 0;
52
 
  optarg = NULL;
53
 
 
54
 
  /*
55
 
   * Parse command line options to the application via standard system calls.
56
 
   */
57
 
  while ((c = getopt (argc, argv, optstring)) != -1)
58
 
    {
59
 
      switch (c)
60
 
        {
61
 
        case 'h':
62
 
          USAGE (commandname);
63
 
          return (0);
64
 
 
65
 
        default:
66
 
          USAGE (commandname);
67
 
          return (-1);
68
 
        }
69
 
    }
70
 
 
71
 
  if (optind < argc)
72
 
    {
73
 
      printf ("\nWrong option(s): \" ");
74
 
      while (optind < argc)
75
 
        printf ("%s ", argv [optind ++]);
76
 
      printf ("\"\n");
77
 
      USAGE (commandname);
78
 
      printf ("\n");
79
 
      return (-1);
80
 
    }
81
 
 
82
 
  fflush (stdout);
83
 
 
84
 
  return (0);
85
 
}