26 enum pcap_mode pcap_mode
;
27 enum dev_io_mode_t mode
;
31 const struct pcap_file_ops
*pcap_ops
;
32 const struct dev_io_ops
*ops
;
36 int(*open
) (struct dev_io
*dev
, const char *name
, enum dev_io_mode_t mode
);
37 int(*write
) (struct dev_io
*dev
, struct packet
*pkt
);
38 struct packet
*(*read
) (struct dev_io
*dev
);
39 int(*set_link_type
) (struct dev_io
*dev
, int link_type
);
40 void(*close
) (struct dev_io
*dev
);
43 extern struct dev_io
*dev_io_create(const char *name
, enum dev_io_mode_t mode
);
44 extern void dev_io_open(struct dev_io
*dev
);
45 extern int dev_io_write(struct dev_io
*dev
, struct packet
*pkt
);
46 extern struct packet
*dev_io_read(struct dev_io
*dev
);
47 extern int dev_io_ifindex_get(struct dev_io
*dev
);
48 extern int dev_io_fd_get(struct dev_io
*dev
);
49 extern const char *dev_io_name_get(struct dev_io
*dev
);
50 extern int dev_io_link_type_set(struct dev_io
*dev
, int link_type
);
51 extern bool dev_io_is_netdev(struct dev_io
*dev
);
52 extern bool dev_io_is_pcap(struct dev_io
*dev
);
53 extern void dev_io_close(struct dev_io
*dev
);
55 #endif /* TRAFGEN_DEV_H */