"Fossies" - the Fresh Open Source Software Archive

Member "liboping-1.10.0/src/oping.h" (11 May 2017, 2832 Bytes) of package /linux/privat/liboping-1.10.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "oping.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.9.0_vs_1.10.0.

    1 /**
    2  * Object oriented C module to send ICMP and ICMPv6 `echo's.
    3  * Copyright (C) 2006-2017  Florian octo Forster <ff at octo.it>
    4  *
    5  * This library is free software; you can redistribute it and/or modify it
    6  * under the terms of the GNU Lesser General Public License as published by the
    7  * Free Software Foundation; either version 2.1 of the License, or (at your
    8  * option) any later version.
    9  * 
   10  * This library is distributed in the hope that it will be useful, but WITHOUT
   11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
   13  * for more details.
   14  * 
   15  * You should have received a copy of the GNU Lesser General Public License
   16  * along with this library; if not, write to the Free Software Foundation,
   17  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
   18  */
   19 
   20 #ifndef OCTO_PING_H
   21 #define OCTO_PING_H 1
   22 
   23 #if HAVE_CONFIG_H
   24 # include <config.h>
   25 #endif
   26 
   27 #include <stdlib.h>
   28 #include <unistd.h>
   29 #include <sys/types.h>
   30 #include <sys/socket.h>
   31 
   32 #ifdef __cplusplus
   33 extern "C" {
   34 #endif
   35 
   36 #define OPING_VERSION 1009000
   37 
   38 /*
   39  * Type definitions
   40  */
   41 struct pinghost;
   42 typedef struct pinghost pinghost_t;
   43 
   44 typedef pinghost_t pingobj_iter_t;
   45 
   46 struct pingobj;
   47 typedef struct pingobj pingobj_t;
   48 
   49 #define PING_OPT_TIMEOUT 0x01
   50 #define PING_OPT_TTL     0x02
   51 #define PING_OPT_AF      0x04
   52 #define PING_OPT_DATA    0x08
   53 #define PING_OPT_SOURCE  0x10
   54 #define PING_OPT_DEVICE  0x20
   55 #define PING_OPT_QOS     0x40
   56 #define PING_OPT_MARK    0x80
   57 
   58 #define PING_DEF_TIMEOUT 1.0
   59 #define PING_DEF_TTL     255
   60 #define PING_DEF_AF      AF_UNSPEC
   61 #define PING_DEF_DATA    "liboping -- ICMP ping library <http://octo.it/liboping/>"
   62 
   63 /*
   64  * Method definitions
   65  */
   66 pingobj_t *ping_construct (void);
   67 void ping_destroy (pingobj_t *obj);
   68 
   69 int ping_setopt (pingobj_t *obj, int option, void *value);
   70 
   71 int ping_send (pingobj_t *obj);
   72 
   73 int ping_host_add (pingobj_t *obj, const char *host);
   74 int ping_host_remove (pingobj_t *obj, const char *host);
   75 
   76 pingobj_iter_t *ping_iterator_get (pingobj_t *obj);
   77 pingobj_iter_t *ping_iterator_next (pingobj_iter_t *iter);
   78 int ping_iterator_count (pingobj_t *obj);
   79 
   80 #define PING_INFO_HOSTNAME  1
   81 #define PING_INFO_ADDRESS   2
   82 #define PING_INFO_FAMILY    3
   83 #define PING_INFO_LATENCY   4
   84 #define PING_INFO_SEQUENCE  5
   85 #define PING_INFO_IDENT     6
   86 #define PING_INFO_DATA      7
   87 #define PING_INFO_USERNAME  8
   88 #define PING_INFO_DROPPED   9
   89 #define PING_INFO_RECV_TTL 10
   90 #define PING_INFO_RECV_QOS 11
   91 int ping_iterator_get_info (pingobj_iter_t *iter, int info,
   92         void *buffer, size_t *buffer_len);
   93 
   94 const char *ping_get_error (pingobj_t *obj);
   95 
   96 void *ping_iterator_get_context (pingobj_iter_t *iter);
   97 void  ping_iterator_set_context (pingobj_iter_t *iter, void *context);
   98 
   99 #ifdef __cplusplus
  100 }
  101 #endif
  102 
  103 #endif /* OCTO_PING_H */