24 enum pcap_mode pcap_mode
;
26 const struct pcap_file_ops
*pcap_ops
;
27 const struct dev_io_ops
*ops
;
31 int(*open
) (struct dev_io
*dev
, const char *name
, enum dev_io_mode_t mode
);
32 int(*write
) (struct dev_io
*dev
, const uint8_t *buf
, size_t len
);
33 int(*read
) (struct dev_io
*dev
, uint8_t *buf
, size_t len
, struct timespec
*tstamp
);
34 void(*close
) (struct dev_io
*dev
);
37 extern struct dev_io
*dev_io_open(const char *name
, enum dev_io_mode_t mode
);
38 extern int dev_io_write(struct dev_io
*dev
, const uint8_t *buf
, size_t len
);
39 extern int dev_io_read(struct dev_io
*dev
, uint8_t *buf
, size_t len
,
40 struct timespec
*tstamp
);
41 extern int dev_io_ifindex_get(struct dev_io
*dev
);
42 extern int dev_io_fd_get(struct dev_io
*dev
);
43 extern const char *dev_io_name_get(struct dev_io
*dev
);
44 extern void dev_io_link_type_set(struct dev_io
*dev
, int link_type
);
45 extern bool dev_io_is_netdev(struct dev_io
*dev
);
46 extern bool dev_io_is_pcap(struct dev_io
*dev
);
47 extern void dev_io_close(struct dev_io
*dev
);
49 #endif /* TRAFGEN_DEV_H */