summaryrefslogtreecommitdiff
path: root/trafgen_dev.h
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2017-07-17 09:06:36 +0300
committerTobias Klauser <tklauser@distanz.ch>2017-07-17 09:15:46 +0200
commit3261379f19ad0da4c32e8ab5654a84bf5d17282a (patch)
tree6a8663871fb9b7987e24b468d81a971cb76e8f0f /trafgen_dev.h
parent551aa0ee996132e443b5d12cbb6f114ac9aabcd3 (diff)
trafgen: Delegate creation of rfraw to dev_io API
Simplify a bit of creation rfraw device by delegating it to the dev_io API, also in case the output device is pcap file the --rfraw option sets the link type to ieee80211 radio tap. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_dev.h')
-rw-r--r--trafgen_dev.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/trafgen_dev.h b/trafgen_dev.h
index 720c630..686a577 100644
--- a/trafgen_dev.h
+++ b/trafgen_dev.h
@@ -16,6 +16,7 @@ struct dev_io_ops;
struct dev_io {
int fd;
char *name;
+ char *trans;
int ifindex;
int dev_type;
uint32_t link_type;
@@ -31,6 +32,7 @@ struct dev_io_ops {
int(*open) (struct dev_io *dev, const char *name, enum dev_io_mode_t mode);
int(*write) (struct dev_io *dev, const uint8_t *buf, size_t len);
int(*read) (struct dev_io *dev, uint8_t *buf, size_t len, struct timespec *tstamp);
+ int(*set_link_type) (struct dev_io *dev, int link_type);
void(*close) (struct dev_io *dev);
};
@@ -41,7 +43,7 @@ extern int dev_io_read(struct dev_io *dev, uint8_t *buf, size_t len,
extern int dev_io_ifindex_get(struct dev_io *dev);
extern int dev_io_fd_get(struct dev_io *dev);
extern const char *dev_io_name_get(struct dev_io *dev);
-extern void dev_io_link_type_set(struct dev_io *dev, int link_type);
+extern int dev_io_link_type_set(struct dev_io *dev, int link_type);
extern bool dev_io_is_netdev(struct dev_io *dev);
extern bool dev_io_is_pcap(struct dev_io *dev);
extern void dev_io_close(struct dev_io *dev);