Fix manpage-check on RHEL 5.
[sliver-openvswitch.git] / lib / ofp-util.h
index e70d963..5af9d2b 100644 (file)
@@ -277,6 +277,9 @@ struct ofpbuf *make_unbuffered_packet_out(const struct ofpbuf *packet,
                                           uint16_t in_port, uint16_t out_port);
 struct ofpbuf *make_echo_request(void);
 struct ofpbuf *make_echo_reply(const struct ofp_header *rq);
+
+const char *ofputil_frag_handling_to_string(enum ofp_config_flags);
+bool ofputil_frag_handling_from_string(const char *, enum ofp_config_flags *);
 \f
 /* Actions. */
 
@@ -334,6 +337,30 @@ enum ofputil_action_code ofputil_decode_action_unsafe(
 
 int ofputil_action_code_from_name(const char *);
 
+void *ofputil_put_action(enum ofputil_action_code, struct ofpbuf *buf);
+
+/* For each OpenFlow action <ENUM> that has a corresponding action structure
+ * struct <STRUCT>, this defines two functions:
+ *
+ *   void ofputil_init_<ENUM>(struct <STRUCT> *action);
+ *
+ *     Initializes the parts of 'action' that identify it as having type <ENUM>
+ *     and length 'sizeof *action' and zeros the rest.  For actions that have
+ *     variable length, the length used and cleared is that of struct <STRUCT>.
+ *
+ *  struct <STRUCT> *ofputil_put_<ENUM>(struct ofpbuf *buf);
+ *
+ *     Appends a new 'action', of length 'sizeof(struct <STRUCT>)', to 'buf',
+ *     initializes it with ofputil_init_<ENUM>(), and returns it.
+ */
+#define OFPAT_ACTION(ENUM, STRUCT, NAME)                \
+    void ofputil_init_##ENUM(struct STRUCT *);          \
+    struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *);
+#define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME)    \
+    void ofputil_init_##ENUM(struct STRUCT *);          \
+    struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *);
+#include "ofp-util.def"
+
 #define OFP_ACTION_ALIGN 8      /* Alignment of ofp_actions. */
 
 static inline union ofp_action *
@@ -523,4 +550,7 @@ int ofputil_decode_error_msg(const struct ofp_header *, size_t *payload_ofs);
 void ofputil_format_error(struct ds *, int error);
 char *ofputil_error_to_string(int error);
 
+/* Handy utility for parsing flows and actions. */
+bool ofputil_parse_key_value(char **stringp, char **keyp, char **valuep);
+
 #endif /* ofp-util.h */