📄 fromrawsocket.hh
字号:
// -*- mode: c++; c-basic-offset: 2 -*-#ifndef CLICK_FROMRAWSOCKET_HH#define CLICK_FROMRAWSOCKET_HH#include <click/element.hh>CLICK_DECLS/*=cFromRawSocket("TCP", <TCP source port number> [, I<KEYWORDS>])FromRawSocket("UDP", <UDP source port number> [, I<KEYWORDS>])FromRawSocket("GRE", <GRE key or PPTP call ID> [, I<KEYWORDS>])FromRawSocket("ICMP", <ICMP identifier> [, I<KEYWORDS>])FromRawSocket("ICMP_TCP", <TCP source port number> [, I<KEYWORDS>])FromRawSocket("ICMP_UDP", <UDP source port number> [, I<KEYWORDS>])FromRawSocket("ICMP_GRE", <GRE key or PPTP call ID> [, I<KEYWORDS>])=s devicesreads data from safe raw socket (user-level)=dReads data from the specified PlanetLab 2.0 safe raw IPv4 socket (seehttp://www.planet-lab.org/raw_sockets/). The safe raw IPv4 socket mustbe bound to a source port number in the case of TCP/UDP, a GRE key orPPTP call ID in the case of GRE, or an identifier in the case ofICMP. In the case of ICMP_TCP, ICMP_UDP, or ICMP_GRE, specify a sourceport number, GRE key, or PPTP call ID to receive ICMP errorsassociated with those connections.Keyword arguments are:=over 8=item SNAPLENUnsigned integer. Maximum packet length. This valuerepresents the MRU of the FromRawSocket if it is used as apacket source. If the MRU is violated by the peer, i.e. if a packetlonger than SNAPLEN is sent, the connection may be terminated.=item SNIFFBoolean. When true, FromRawSocket will be a raw "sniffer" socket.=back=e FromRawSocket(UDP, 53) -> ...=a ToRawSocket, FromSocket, ToSocket */class FromRawSocket : public Element { public: FromRawSocket(); ~FromRawSocket(); const char *class_name() const { return "FromRawSocket"; } int configure(Vector<String> &conf, ErrorHandler *); int initialize(ErrorHandler *); void cleanup(CleanupStage); int protocol() const { return _protocol; } int port() const { return _port; } int fd() const { return _fd; } void selected(int); private: int _fd; int _protocol; uint16_t _port; int _snaplen; bool _sniff; WritablePacket *_packet; int initialize_socket_error(ErrorHandler *, const char *);};CLICK_ENDDECLS#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -