X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetlink.h;h=a5c129ab296836aee2e9ecd9e48916301a1b26a0;hb=eb857b4824d2a62e1cc1b85c30a3da007d4942c9;hp=b7a87c6c39aa0e675abd5d84c7019e1e481d71d7;hpb=3a706b33aab1d5b79394ee74bd3a34d2bf00093c;p=sliver-openvswitch.git diff --git a/lib/netlink.h b/lib/netlink.h index b7a87c6c3..a5c129ab2 100644 --- a/lib/netlink.h +++ b/lib/netlink.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -184,6 +184,11 @@ struct nl_policy bool optional; }; +#define NL_POLICY_FOR(TYPE) \ + .type = NL_A_UNSPEC, .min_len = sizeof(TYPE), .max_len = sizeof(TYPE) + +bool nl_attr_validate(const struct nlattr *, const struct nl_policy *); + bool nl_policy_parse(const struct ofpbuf *, size_t offset, const struct nl_policy[], struct nlattr *[], size_t n_attrs);