# otCoapOptionIterator Struct Reference

# otCoapOptionIterator


`#include <openthread/coap.h>`

Acts as an iterator for CoAP options.

## Summary

| ### Public attributes ||
|---|---|
| `https://openthread.io/reference/struct/ot-coap-option-iterator#structot_coap_option_iterator_1aa5170f118e38e551ec71eeee91ebd2d6` | `const https://openthread.io/reference/group/api-message#group__api-message_1ga42d128a0a9ad58de0eb79673843c2955 *` CoAP message. |
| `https://openthread.io/reference/struct/ot-coap-option-iterator#structot_coap_option_iterator_1ae0ac3061e46ecad9ea014b776abc038e` | `uint16_t` Byte offset of next option. |
| `https://openthread.io/reference/struct/ot-coap-option-iterator#structot_coap_option_iterator_1ab63c3d9f61dac87ac0a04be0565d2017` | `https://openthread.io/reference/struct/ot-coap-option` CoAP message option. |

## Public attributes

### mMessage

```
const otMessage * otCoapOptionIterator::mMessage
```
CoAP message.

### mNextOptionOffset

```
uint16_t otCoapOptionIterator::mNextOptionOffset
```
Byte offset of next option.

### mOption

```
otCoapOption otCoapOptionIterator::mOption
```
CoAP message option.

## Resources

OpenThread API Reference topics originate from the source code, available
on [GitHub](https://github.com/openthread/openthread/tree/main/include/openthread).
For more information, or to contribute to our documentation, refer to
[Resources](https://openthread.io/resources).