2#ifndef CLICK_FROMFILE_HH
3#define CLICK_FROMFILE_HH
13class FromFile {
public:
16 ~FromFile() { cleanup(); }
18 const String &filename()
const {
return _filename; }
19 String &filename() {
return _filename; }
20 bool initialized()
const {
return _fd != -1; }
22 void set_landmark_pattern(
const String &lp) { _landmark_pattern = lp; }
24 String landmark()
const {
return landmark(_landmark_pattern); }
25 String print_filename()
const;
26 int lineno()
const {
return _lineno; }
27 void set_lineno(
int lineno) { _lineno = lineno; }
29 off_t file_pos()
const {
return _file_offset + _pos; }
33 int initialize(
ErrorHandler* errh,
bool allow_nonexistent =
false);
34 void add_handlers(
Element* e,
bool filepos_writable =
false)
const;
42 const uint8_t* get_unaligned(
size_t,
void*,
ErrorHandler* = 0);
43 const uint8_t* get_aligned(
size_t,
void*,
ErrorHandler* = 0);
46 Packet* get_packet_from_data(
const void *buf,
size_t buf_size,
size_t full_size, uint32_t sec, uint32_t subsec,
ErrorHandler *);
47 void shift_pos(
int delta) { _pos += delta; }
52 int error(
ErrorHandler *,
const char *format, ...)
const;
53 int warning(
ErrorHandler *,
const char *format, ...)
const;
56 enum { BUFFER_SIZE = 32768 };
62#if !CLICK_PACKET_USE_DPDK
64 const uint8_t *_buffer;
66 unsigned char _buffer[BUFFER_SIZE];
77 enum { WANT_MMAP_UNIT = 4194304 };
Base class for Click elements.
Definition element.hh:42
Error reporting class.
Definition error.hh:90
A network packet.
Definition packet.hh:68
A string of characters.
Definition string.hh:22
Vector template.
Definition vector.hh:111
A network packet believed not to be shared.
Definition packet.hh:1004
Click's vector container template.