// -*- c++ -*-
// $Id: pc.h 1082 2005-02-12 19:40:04Z bmah $
//
// pc.h
// Bruce A. Mah <bmah@acm.org>
//
// This work was first produced by an employee of Sandia National
// Laboratories under a contract with the U.S. Department of Energy.
// Sandia National Laboratories dedicates whatever right, title or
// interest it may have in this software to the public. Although no
// license from Sandia is needed to copy and use this software,
// copying and using the software might infringe the rights of
// others. This software is provided as-is. SANDIA DISCLAIMS ANY
// WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.
//
// Global definitions, macros, and so forth
//
#ifndef PC_H
#define PC_H
// Debugging macros
extern int DebugLevel;
#define IF_DEBUG(level, action) if (DebugLevel >= level) { action; }
// bool type might not be available everywhere
#if (SIZEOF_BOOL == 0)
typedef enum {false, true} bool;
#endif /* SIZEOF_BOOL */
// Mode types
typedef enum {
ModeNone,
ModePchar,
ModeTrout
} ModeType;
// Network protocol types
typedef enum {
NetworkProtocolNone,
NetworkProtocolIpv4Udp,
NetworkProtocolIpv4Raw,
NetworkProtocolIpv4Tcp,
NetworkProtocolIpv4Icmp,
NetworkProtocolIpv4File
#ifdef HAVE_IPV6
,
NetworkProtocolIpv6Icmp,
NetworkProtocolIpv6Udp,
NetworkProtocolIpv6File,
NetworkProtocolIpv6Tcp
#endif /* HAVE_IPV6 */
} NetworkProtocolType;
// Analysis types
typedef enum {
AnalysisNone,
AnalysisLeastSquares,
AnalysisKendall,
AnalysisLeastMedianSquares,
AnalysisLeastMedianSquaresIntegers
} AnalysisType;
// Gap types
typedef enum {
GapNone,
GapFixed,
GapExponential
} GapType;
// Linux networking compatability macros. For some unfathomable
// reason, Linux systems seem to have named many of their networking
// constants differently than those used by virtually every other
// sockets API implementation. We try to bring it in line with
// the more widely-used sockets API standards here.
#ifdef linux
// UDP
#define uh_sport source
#define uh_dport dest
#define uh_ulen len
#define uh_sum check
#endif /* linux */
// Make sure we have a definition for the maximum IP packet size.
// Apparently some Linux systems don't have this defined.
#ifndef IP_MAXPACKET
#define IP_MAXPACKET 65535
#endif /* IP_MAXPACKET */
// Ditto for IPv6 maximum packet size.
#ifndef IPV6_MAXPACKET
#define IPV6_MAXPACKET 65535
#endif /* IPV6_MAXPACKET */
// Some systems might not have MAXTTL
#ifndef MAXTTL
#define MAXTTL 255
#endif /* MAXTTL */
// Some systems might not have IPV6_MAXHLIM. This is intended for Linux
// systems (observed on RH 7.1), but might be applicable elsewhere.
// NRL-derived IPv6 systems have this constant defined below.
#ifndef IPV6_MAXHLIM
#ifndef NEED_NRL_IPV6_HACK
#define IPV6_MAXHLIM 255
#endif /* NEED_NRL_IPV6_HACK */
#endif /* IPV6_MAXHLIM */
// Define ICMP unreachable codes that might not be otherwise
// available. (Solaris 2.5.1 and 2.6 have this problem.)
#define ICMP_UNREACH_FILTER_PROHIB 13
// Solaris 2.5.1 (and earlier?) for some reason is lacking the
// prototype for random(3). We give them one.
//
// It turns out that Linux glibc2 needs this too, since a mutually
// incompatible set of preprocessor defines is necessary to get
// the headers to define both BSD-style network structures
// and the random(3) prototype. So we punt on this and roll our
// own.
#ifdef NEED_RANDOM_PROTO
extern "C" {
long random(void);
void srandom(unsigned int);
}
#endif /* NEED_RANDOM_PROTO */
// NRL IPv6 stack hacks. Basically, they define data structures,
// constants, etc. with different names than KAME (and, apparently,
// the API RFCs). Some of these we can take care of with some
// preprocessor definitions; others require some different headers.
#ifdef NEED_NRL_IPV6_HACK
#define ip6_hdr ipv6hdr
#define ip6_nxt ipv6_nextheader
#define IPV6_MAXHLIM IPV6_HOPLIMIT
#define icmp6_hdr icmpv6hdr
#define icmp6_type icmpv6_type
#define icmp6_code icmpv6_code
#define icmp6_id icmpv6_id
#define icmp6_seq icmpv6_seq
#define ICMP6_ECHO_REQUEST ICMPV6_ECHO_REQUEST
#define ICMP6_ECHO_REPLY ICMPV6_ECHO_REPLY
#define ICMP6_TIME_EXCEEDED ICMPV6_TIME_EXCEEDED
#define ICMP6_DST_UNREACH ICMPV6_DST_UNREACH
#define ICMP6_DST_UNREACH_ADMIN ICMPV6_UNREACH_ADMIN
#define ICMP6_DST_UNREACH_NOPORT ICMPV6_UNREACH_PORT
#define icmp6_filter icmpv6_filter
#define ICMP6_FILTER ICMPV6_FILTER
#define ICMP6_FILTER_SETBLOCKALL ICMPV6_FILTER_SETBLOCKALL
#define ICMP6_FILTER_SETPASS ICMPV6_FILTER_SETPASS
#endif /* NEED_NRL_IPV6_HACK */
#endif /* PC_H */
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共48个文件
h:17个
cc:17个
in:3个
PChar类似于pathchar,试图通过沿一个终端到端到端路径表征互联网的带宽,时延,链路损耗。 它已经过测试各种版本的FreeBSD,NetBSD的,OpenBSD的,LINUX,Solaris和OSF / 1和IRIX,FreeBSD和Solaris。最近增加PChar类型包括:SNMP查询功能,以及更好的IPv6配置时间检测
资源推荐
资源详情
资源评论
收起资源包目录
pchar-1.5.tar.gz (48个子文件)
pchar-1.5
PctestIpv6Udp.cc 12KB
PctestIpv4Raw.h 1KB
PctestIpv4Udp.h 1KB
Kendall.h 988B
TestRecord.cc 4KB
FAQ 3KB
PctestIpv6File.h 2KB
GetIfInfo.h 821B
ResultTable.h 2KB
pc.h 5KB
PctestIpv4Raw.cc 14KB
mkinstalldirs 718B
PctestIpv4File.cc 8KB
PctestIpv4.h 2KB
PctestIpv6.cc 15KB
PctestIpv4Tcp.h 1KB
PctestIpv6Tcp.cc 14KB
main.cc 47KB
Pctest.cc 6KB
aclocal.m4 18KB
CHANGES 14KB
config.guess 39KB
config.sub 27KB
PctestIpv4Udp.cc 10KB
PctestIpv6Udp.h 1KB
configure.in 6KB
pchar.8 13KB
PctestIpv6Icmp.cc 16KB
README 7KB
PctestIpv6File.cc 8KB
Makefile.in 8KB
PctestIpv4Icmp.h 1KB
PctestIpv4Icmp.cc 14KB
VERSION 5B
install-sh 5KB
PctestIpv4File.h 2KB
PctestIpv6Icmp.h 2KB
PctestIpv6Tcp.h 1KB
configure 74KB
GetIfInfo.cc 8KB
PctestIpv4Tcp.cc 13KB
Kendall.cc 3KB
TestRecord.h 2KB
PctestIpv4.cc 11KB
Pctest.h 4KB
ResultTable.cc 25KB
PctestIpv6.h 3KB
Makefile.depend.in 798B
共 48 条
- 1
资源评论
- newborn_green2012-05-12挺好的,能够在Linux上解压并使用。原是下载pathchar的,找不到就下了这个类似的,大体用法还是一样的。蛮好的
- looxi2013-10-09可以编译,但是想要做修改的话太麻烦。
- deedin2014-04-26很好的资源,可以编译。
yzj19870824
- 粉丝: 14
- 资源: 16
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功