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