... to be able to return a negative error code for unknown modes.
[thaller@redhat.com: This is potentially an ABI break, but since
the size of the enum is implementation defined, it seems
anyway unstable to have them as function arguments/return values.]
http://lists.infradead.org/pipermail/libnl/2014-August/001616.html
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
extern char * nfnl_log_copy_mode2str(enum nfnl_log_copy_mode,
char *, size_t);
-extern enum nfnl_log_copy_mode nfnl_log_str2copy_mode(const char *);
+extern int nfnl_log_str2copy_mode(const char *);
extern void nfnl_log_set_copy_range(struct nfnl_log *, uint32_t);
extern int nfnl_log_test_copy_range(const struct nfnl_log *);
extern char * nfnl_queue_copy_mode2str(enum nfnl_queue_copy_mode,
char *, size_t);
-extern enum nfnl_queue_copy_mode nfnl_queue_str2copy_mode(const char *);
+extern int nfnl_queue_str2copy_mode(const char *);
extern void nfnl_queue_set_copy_range(struct nfnl_queue *,
uint32_t);
ARRAY_SIZE(copy_modes));
}
-enum nfnl_log_copy_mode nfnl_log_str2copy_mode(const char *name)
+int nfnl_log_str2copy_mode(const char *name)
{
return __str2type(name, copy_modes, ARRAY_SIZE(copy_modes));
}
ARRAY_SIZE(copy_modes));
}
-enum nfnl_queue_copy_mode nfnl_queue_str2copy_mode(const char *name)
+int nfnl_queue_str2copy_mode(const char *name)
{
return __str2type(name, copy_modes, ARRAY_SIZE(copy_modes));
}
struct nl_sock *rt_sock;
struct nl_cache *link_cache;
struct nfnl_log *log;
- enum nfnl_log_copy_mode copy_mode;
+ int copy_mode;
uint32_t copy_range;
int err;
int family;
struct nl_sock *rt_sock;
struct nl_cache *link_cache;
struct nfnl_queue *queue;
- enum nfnl_queue_copy_mode copy_mode;
+ int copy_mode;
uint32_t copy_range;
int err = 1;
int family;