IOT-1072 Unfork libcoap: update forked headers
[platform/upstream/iotivity.git] / resource / csdk / connectivity / lib / libcoap-4.1.1 / include / coap / option.h
index 8441d5a..6463afd 100644 (file)
@@ -82,7 +82,7 @@ size_t coap_opt_size(const coap_opt_t *opt);
  * @param pdu The PDU containing the options.
  * @return A pointer to the first option if available, or @c NULL otherwise.
  */
-coap_opt_t *options_start(coap_pdu_t *pdu, coap_transport_type transport);
+coap_opt_t *options_start(coap_pdu_t *pdu, coap_transport_t transport);
 
 /**
  * Interprets @p opt as pointer to a CoAP option and advances to
@@ -189,6 +189,26 @@ typedef struct
 } coap_opt_iterator_t;
 
 /**
+ * Initializes the given option iterator @p oi to point to the beginning of the
+ * @p pdu's option list. This function returns @p oi on success, @c NULL
+ * otherwise (i.e. when no options exist). Note that a length check on the
+ * option list must be performed before coap_option_iterator_init() is called.
+ *
+ * @param pdu    The PDU the options of which should be walked through.
+ * @param oi     An iterator object that will be initilized.
+ * @param filter An optional option type filter.
+ *               With @p type != @c COAP_OPT_ALL, coap_option_next()
+ *               will return only options matching this bitmask.
+ *               Fence-post options @c 14, @c 28, @c 42, ... are always
+ *               skipped.
+ *
+ * @return       The iterator object @p oi on success, @c NULL otherwise.
+ */
+coap_opt_iterator_t *coap_option_iterator_init(coap_pdu_t *pdu,
+                                               coap_opt_iterator_t *oi,
+                                               const coap_opt_filter_t filter);
+
+/**
  * Initializes the given option iterator @p oi to point to the
  * beginning of the @p pdu's option list. This function returns @p oi
  * on success, @c NULL otherwise (i.e. when no options exist).
@@ -205,8 +225,8 @@ typedef struct
  *
  * @return The iterator object @p oi on success, @c NULL otherwise.
  */
-coap_opt_iterator_t *coap_option_iterator_init(coap_pdu_t *pdu, coap_opt_iterator_t *oi,
-        const coap_opt_filter_t filter, coap_transport_type transport);
+coap_opt_iterator_t *coap_option_iterator_init2(coap_pdu_t *pdu, coap_opt_iterator_t *oi,
+        const coap_opt_filter_t filter, coap_transport_t transport);
 
 /**
  * Updates the iterator @p oi to point to the next option. This