#endif
return FALSE;
}
+
+/**
+ * See header.
+ */
+void* payload_get_field(payload_t *payload, encoding_type_t type, u_int skip)
+{
+ encoding_rule_t *rule;
+ size_t count;
+ int i;
+
+ payload->get_encoding_rules(payload, &rule, &count);
+ for (i = 0; i < count; i++)
+ {
+ if (rule[i].type == type && skip-- == 0)
+ {
+ return ((char*)payload) + rule[i].offset;
+ }
+ }
+ return NULL;
+}
*/
bool payload_is_known(payload_type_t type);
+/**
+ * Get the value field in a payload using encoding rules.
+ *
+ * @param payload payload to look up a field
+ * @param type encoding rule type to look up
+ * @param skip number rules of type to skip, 0 to get first
+ * @return type specific value pointer, NULL if not found
+ */
+void* payload_get_field(payload_t *payload, encoding_type_t type, u_int skip);
+
#endif /** PAYLOAD_H_ @}*/