| 1 |
# header_detect_io requirements |
| 2 |
|
| 3 |
## Overview |
| 4 |
|
| 5 |
`header_detect_io` is module that detects which AMQP header is being received and creates an appropriate IO for the detected header. |
| 6 |
|
| 7 |
## Exposed API |
| 8 |
|
| 9 |
```C |
| 10 |
|
| 11 |
typedef struct AMQP_HEADER_TAG |
| 12 |
{ |
| 13 |
const unsigned char* header_bytes; |
| 14 |
size_t header_size; |
| 15 |
} AMQP_HEADER; |
| 16 |
|
| 17 |
typedef struct HEADER_DETECT_ENTRY_TAG |
| 18 |
{ |
| 19 |
AMQP_HEADER header; |
| 20 |
const IO_INTERFACE_DESCRIPTION* io_interface_description; |
| 21 |
} HEADER_DETECT_ENTRY; |
| 22 |
|
| 23 |
typedef struct HEADER_DETECT_IO_CONFIG_TAG |
| 24 |
{ |
| 25 |
XIO_HANDLE underlying_io; |
| 26 |
HEADER_DETECT_ENTRY* header_detect_entries; |
| 27 |
size_t header_detect_entry_count; |
| 28 |
} HEADER_DETECT_IO_CONFIG; |
| 29 |
|
| 30 |
MOCKABLE_FUNCTION(, const AMQP_HEADER, header_detect_io_get_amqp_header); |
| 31 |
MOCKABLE_FUNCTION(, const AMQP_HEADER, header_detect_io_get_sasl_amqp_header); |
| 32 |
MOCKABLE_FUNCTION(, const IO_INTERFACE_DESCRIPTION*, header_detect_io_get_interface_description); |
| 33 |
``` |
| 34 |
|
| 35 |
### header_detect_io_create |
| 36 |
|
| 37 |
```C |
| 38 |
CONCRETE_IO_HANDLE header_detect_io_create(void* io_create_parameters); |
| 39 |
``` |
| 40 |
|
| 41 |
`header_detect_io_create` is the implementation provided via `header_detect_io_get_interface_description` for the `concrete_io_create` member. |
| 42 |
|
| 43 |
**SRS_HEADER_DETECT_IO_01_001: [** `header_detect_io_create` shall create a new header detect IO instance and on success it shall return a non-NULL handle to the newly created instance. **]** |
| 44 |
**SRS_HEADER_DETECT_IO_01_002: [** If allocating memory for the header detect IO instance fails, `header_detect_io_create` shall fail and return NULL. **]** |
| 45 |
**SRS_HEADER_DETECT_IO_01_003: [** If `io_create_parameters` is NULL, `header_detect_io_create` shall fail and return NULL. **]** |
| 46 |
**SRS_HEADER_DETECT_IO_01_004: [** `io_create_parameters` shall be used as `HEADER_DETECT_IO_CONFIG*`. **]** |
| 47 |
**SRS_HEADER_DETECT_IO_01_005: [** If the member `header_detect_entry_count` of `HEADER_DETECT_IO_CONFIG` is 0 then `header_detect_io_create` shall fail and return NULL. **]** |
| 48 |
**SRS_HEADER_DETECT_IO_01_006: [** If the member `header_detect_entries` is NULL then `header_detect_io_create` shall fail and return NULL. **]** |
| 49 |
**SRS_HEADER_DETECT_IO_01_007: [** If the member `underlying_io` is NULL then `header_detect_io_create` shall fail and return NULL. **]** |
| 50 |
**SRS_HEADER_DETECT_IO_01_008: [** If the `header` member in the `header_detect_entries` is NULL then `header_detect_io_create` shall fail and return NULL. **]** |
| 51 |
**SRS_HEADER_DETECT_IO_01_052: [** The `io` member in the in each of the `header_detect_entries` shall be allowed to be NULL. **]** |
| 52 |
**SRS_HEADER_DETECT_IO_01_054: [** At least one entry in `header_detect_entries` shall have IO set to NULL, otherwise `header_detect_io_create` shall fail and return NULL. **]** |
| 53 |
**SRS_HEADER_DETECT_IO_01_009: [** The `header_detect_entries` array shall be copied so that it can be later used when detecting which header was received. **]** |
| 54 |
**SRS_HEADER_DETECT_IO_01_014: [** For each entry in `header_detect_entries` the `header` field shall also be copied. **]** |
| 55 |
**SRS_HEADER_DETECT_IO_01_010: [** If allocating memory for the `header_detect_entries` or its constituents fails then `header_detect_io_create` shall fail and return NULL. **]** |
| 56 |
**SRS_HEADER_DETECT_IO_01_060: [** `header_detect_io_create` shall create a singly linked list by calling `singlylinkedlist_create` where the chained detected IOs shall be stored. **]** |
| 57 |
**SRS_HEADER_DETECT_IO_01_065: [** If `singlylinkedlist_create` fails then `header_detect_io_create` shall fail and return NULL. **]** |
| 58 |
|
| 59 |
### header_detect_io_destroy |
| 60 |
|
| 61 |
```C |
| 62 |
void header_detect_io_destroy(CONCRETE_IO_HANDLE header_detect_io) |
| 63 |
``` |
| 64 |
|
| 65 |
`header_detect_io_destroy` is the implementation provided via `header_detect_io_get_interface_description` for the `concrete_io_destroy` member. |
| 66 |
|
| 67 |
**SRS_HEADER_DETECT_IO_01_011: [** `header_detect_io_destroy` shall free all resources associated with the `header_detect_io` handle. **]** |
| 68 |
**SRS_HEADER_DETECT_IO_01_013: [** `header_detect_io_destroy` shall free the memory allocated for the `header_detect_entries`. **]** |
| 69 |
**SRS_HEADER_DETECT_IO_01_012: [** If `header_detect_io` is NULL, `header_detect_io_destroy` shall do nothing. **]** |
| 70 |
**SRS_HEADER_DETECT_IO_01_061: [** `header_detect_io_destroy` shall destroy the chained IO list by calling `singlylinkedlist_destroy`. **]** |
| 71 |
**SRS_HEADER_DETECT_IO_01_062: [** If the IO is still open when `header_detect_io_destroy` is called, all actions normally executed when closing the IO shall also be executed. **]** |
| 72 |
|
| 73 |
### header_detect_io_open_async |
| 74 |
|
| 75 |
```C |
| 76 |
int header_detect_io_open_async(CONCRETE_IO_HANDLE header_detect_io, ON_IO_OPEN_COMPLETE on_io_open_complete, void* on_io_open_complete_context, ON_BYTES_RECEIVED on_bytes_received, void* on_bytes_received_context, ON_IO_ERROR on_io_error, void* on_io_error_context) |
| 77 |
``` |
| 78 |
|
| 79 |
`header_detect_io_open_async` is the implementation provided via `header_detect_io_get_interface_description` for the `concrete_io_open` member. |
| 80 |
|
| 81 |
**SRS_HEADER_DETECT_IO_01_015: [** `header_detect_io_open_async` shall open the underlying IO by calling `xio_open` and passing to it: **]** |
| 82 |
**SRS_HEADER_DETECT_IO_01_016: [** - `xio` shall be the `underlying_io` member of the `io_create_parameters` passed to `header_detect_io_create`. **]** |
| 83 |
**SRS_HEADER_DETECT_IO_01_017: [** - `on_io_open_complete`, `on_io_open_complete_context`, `on_bytes_received`, `on_bytes_received_context`, `on_error` and `on_error_context` shall be set to implementation specific values of `header_detect_io`. **]** |
| 84 |
**SRS_HEADER_DETECT_IO_01_018: [** On success `header_detect_io_open_async` shall return 0. **]** |
| 85 |
**SRS_HEADER_DETECT_IO_01_021: [** If `header_detect_io`, `on_io_open_complete`, `on_bytes_received` or `on_io_error` is NULL, `header_detect_io_open_async` shall fail and return a non-zero value. **]** |
| 86 |
**SRS_HEADER_DETECT_IO_01_019: [** If `xio_open` fails, `header_detect_io_open_async` shall fail and return a non-zero value. **]** |
| 87 |
**SRS_HEADER_DETECT_IO_01_020: [** If the IO is already OPEN or OPENING then `header_detect_io_open_async` shall fail and return a non-zero value. **]** |
| 88 |
|
| 89 |
### header_detect_io_close_async |
| 90 |
|
| 91 |
```C |
| 92 |
int header_detect_io_close_async(CONCRETE_IO_HANDLE header_detect_io, ON_IO_CLOSE_COMPLETE on_io_close_complete, void* callback_context) |
| 93 |
``` |
| 94 |
|
| 95 |
`header_detect_io_close_async` is the implementation provided via `header_detect_io_get_interface_description` for the `concrete_io_close` member. |
| 96 |
|
| 97 |
**SRS_HEADER_DETECT_IO_01_022: [** `header_detect_io_close_async` shall close the underlying IO by calling `xio_close` and passing to it: **]** |
| 98 |
**SRS_HEADER_DETECT_IO_01_023: [** - `xio` shall be the `underlying_io` member of the `io_create_parameters` passed to `header_detect_io_create`. **]** |
| 99 |
**SRS_HEADER_DETECT_IO_01_024: [** - `on_io_close_complete` shall be set to implementation specific values of `header_detect_io`. **]** |
| 100 |
**SRS_HEADER_DETECT_IO_01_025: [** On success `header_detect_io_close_async` shall return 0. **]** |
| 101 |
**SRS_HEADER_DETECT_IO_01_092: [** If `xio_close` fails `header_detect_io_close_async` shall fail and return a non-zero value. **]** |
| 102 |
**SRS_HEADER_DETECT_IO_01_026: [** If `header_detect_io` is NULL, `header_detect_io_close_async` shall fail and return a non-zero value. **]** |
| 103 |
**SRS_HEADER_DETECT_IO_01_094: [** `on_io_close_complete` shall be allowed to be NULL, in which case no close complete callback shall be triggered. **]** |
| 104 |
**SRS_HEADER_DETECT_IO_01_027: [** If the IO is not OPEN (open has not been called or close has been completely carried out) `header_detect_io_close_async` shall fail and return a non-zero value. **]** |
| 105 |
**SRS_HEADER_DETECT_IO_01_028: [** If the IO is OPENING (`header_detect_io_open_async` has been called, but no header has been detected yet), `header_detect_io_close_async` shall close the underlying IO and call `on_io_open_complete` with `IO_OPEN_CANCELLED`. **]** |
| 106 |
**SRS_HEADER_DETECT_IO_01_053: [** If the IO is CLOSING then `header_detect_io_close_async` shall fail and return a non-zero value. **]** |
| 107 |
**SRS_HEADER_DETECT_IO_01_063: [** `header_detect_io_close_async` shall close the last detected IO that was created as a result of matching a header. **]** |
| 108 |
**SRS_HEADER_DETECT_IO_01_070: [** If no detected IO was created then `header_detect_io_close_async` shall close the `underlying_io` passed in `header_detect_io_create`. **]** |
| 109 |
**SRS_HEADER_DETECT_IO_01_064: [** `header_detect_io_close_async` shall also destroy all these chained IOs. **]** |
| 110 |
|
| 111 |
### header_detect_io_send_async |
| 112 |
|
| 113 |
```C |
| 114 |
int header_detect_io_send_async(CONCRETE_IO_HANDLE header_detect_io, const void* buffer, size_t size, ON_SEND_COMPLETE on_send_complete, void* callback_context) |
| 115 |
``` |
| 116 |
|
| 117 |
`header_detect_io_send_async` is the implementation provided via `header_detect_io_get_interface_description` for the `concrete_io_send` member. |
| 118 |
|
| 119 |
**SRS_HEADER_DETECT_IO_01_071: [** If the header IO is open `header_detect_io_send_async` shall send the bytes to the last detected IO by calling `xio_send` that was created as result of matching a header. **]** |
| 120 |
**SRS_HEADER_DETECT_IO_01_029: [** If no detected IO was created, `header_detect_io_send_async` shall send the bytes to the underlying IO passed via `header_detect_io_create`. **]** |
| 121 |
**SRS_HEADER_DETECT_IO_01_030: [** The `buffer`, `size`, `on_send_complete` and `callback_context` shall be passed as is to `xio_send`. **]** |
| 122 |
**SRS_HEADER_DETECT_IO_01_031: [** On success `header_detect_io_send_async` shall return 0. **]** |
| 123 |
**SRS_HEADER_DETECT_IO_01_033: [** If `header_detect_io` or `buffer` is NULL, `header_detect_io_send_async` shall fail and return a non-zero value. **]** |
| 124 |
**SRS_HEADER_DETECT_IO_01_055: [** `on_send_complete` and `callback_context` shall be allowed to be NULL. **]** |
| 125 |
**SRS_HEADER_DETECT_IO_01_034: [** If `size` is 0, `header_detect_io_send_async` shall fail and return a non-zero value. **]** |
| 126 |
**SRS_HEADER_DETECT_IO_01_032: [** If `xio_send` fails, `header_detect_io_send_async` shall fail and return a non-zero value. **]** |
| 127 |
**SRS_HEADER_DETECT_IO_01_093: [** `header_detect_io_send_async` when the IO is not open shall fail and return a non-zero value. **]** |
| 128 |
|
| 129 |
### header_detect_io_dowork |
| 130 |
|
| 131 |
```C |
| 132 |
void header_detect_io_dowork(CONCRETE_IO_HANDLE header_detect_io) |
| 133 |
``` |
| 134 |
|
| 135 |
`header_detect_io_dowork` is the implementation provided via `header_detect_io_get_interface_description` for the `concrete_io_dowork` member. |
| 136 |
|
| 137 |
**SRS_HEADER_DETECT_IO_01_035: [** `header_detect_io_dowork` shall schedule work for the underlying IO associated with `header_detect_io` by calling `xio_dowork` and passing as argument the `underlying_io` member of the `io_create_parameters` passed to `header_detect_io_create`. **]** |
| 138 |
**SRS_HEADER_DETECT_IO_01_036: [** If `header_detect_io` is NULL, `header_detect_io_dowork` shall do nothing. **]** |
| 139 |
**SRS_HEADER_DETECT_IO_01_037: [** No work shall be scheduled if `header_detect_io` is not OPEN or in ERROR (an error has been indicated to the user). **]** |
| 140 |
**SRS_HEADER_DETECT_IO_01_056: [** `header_detect_io_dowork` shall call `xio_dowork` for all detected IOs created as a result of matching headers. **]** |
| 141 |
|
| 142 |
### header_detect_io_set_option |
| 143 |
|
| 144 |
```C |
| 145 |
int header_detect_io_set_option(CONCRETE_IO_HANDLE header_detect_io, const char* option_name, const void* value) |
| 146 |
``` |
| 147 |
|
| 148 |
`header_detect_io_set_option` is the implementation provided via `header_detect_io_get_interface_description` for the `concrete_io_setoption` member. |
| 149 |
|
| 150 |
**SRS_HEADER_DETECT_IO_01_072: [** If any detected IO was created, `header_detect_io_set_option` shall pass any option to the last detected IO by calling `xio_setoption` and passing as IO handle the `underlying_io` member of the `io_create_parameters` passed to `header_detect_io_create`. **]** |
| 151 |
**SRS_HEADER_DETECT_IO_01_042: [** If no detected IO was created `header_detect_io_set_option` shall pass any option to the underlying IO by calling `xio_setoption` and passing as IO handle the `underlying_io` member of the `io_create_parameters` passed to `header_detect_io_create`. **]** |
| 152 |
**SRS_HEADER_DETECT_IO_01_043: [** On success, `header_detect_io_set_option` shall return 0. **]** |
| 153 |
**SRS_HEADER_DETECT_IO_01_044: [** If `header_detect_io` or `option_name` is NULL, `header_detect_io_set_option` shall fail and return a non-zero value. **]** |
| 154 |
**SRS_HEADER_DETECT_IO_01_045: [** If `xio_setoption` fails, `header_detect_io_set_option` shall fail and return a non-zero value. **]** |
| 155 |
|
| 156 |
### header_detect_io_retrieve_options |
| 157 |
|
| 158 |
```C |
| 159 |
OPTIONHANDLER_HANDLE header_detect_io_retrieve_options(CONCRETE_IO_HANDLE header_detect_io) |
| 160 |
``` |
| 161 |
|
| 162 |
`header_detect_io_retrieve_options` is the implementation provided via `header_detect_io_get_interface_description` for the `concrete_io_retrieveoptions` member. |
| 163 |
|
| 164 |
**SRS_HEADER_DETECT_IO_01_038: [** `header_detect_io_retrieve_options` shall create a new `OPTIONHANDLER_HANDLE` by calling `OptionHandler_Create` and on success it shall return a non-NULL handle to the newly created option handler. **]** |
| 165 |
**SRS_HEADER_DETECT_IO_01_039: [** No options shall be added to the newly created option handler. **]** |
| 166 |
**SRS_HEADER_DETECT_IO_01_040: [** If `OptionHandler_Create` fails, `header_detect_io_retrieve_options` shall return NULL. **]** |
| 167 |
**SRS_HEADER_DETECT_IO_01_041: [** If `header_detect_io` is NULL, `header_detect_io_retrieve_options` shall return NULL. **]** |
| 168 |
|
| 169 |
### on_underlying_io_open_complete |
| 170 |
|
| 171 |
```C |
| 172 |
void on_underlying_io_open_complete(void* context, IO_OPEN_RESULT open_result) |
| 173 |
``` |
| 174 |
|
| 175 |
**SRS_HEADER_DETECT_IO_01_046: [** When `on_underlying_io_open_complete` is called with `open_result` being `IO_OPEN_OK` while OPENING, the IO shall start monitoring received bytes in order to detect headers. **]** |
| 176 |
**SRS_HEADER_DETECT_IO_01_047: [** When `on_underlying_io_open_complete` is called with `open_result` being `IO_OPEN_ERROR` while OPENING, the `on_io_open_complete` callback passed to `header_detect_io_open_async` shall be called with `IO_OPEN_ERROR`. **]** |
| 177 |
**SRS_HEADER_DETECT_IO_01_048: [** If `context` is NULL, `on_underlying_io_open_complete` shall do nothing. **]** |
| 178 |
|
| 179 |
### on_underlying_io_close_complete |
| 180 |
|
| 181 |
**SRS_HEADER_DETECT_IO_01_095: [** When `on_underlying_io_open_complete` is called when the IO is closing, it shall destroy all the detected IOs that were created. **]** |
| 182 |
|
| 183 |
### on_underlying_io_error |
| 184 |
|
| 185 |
```C |
| 186 |
void on_underlying_io_error(void* context) |
| 187 |
``` |
| 188 |
|
| 189 |
**SRS_HEADER_DETECT_IO_01_058: [** If `context` is NULL, `on_underlying_io_error` shall do nothing. **]** |
| 190 |
**SRS_HEADER_DETECT_IO_01_057: [** When `on_underlying_io_error` is called while OPENING, the IO shall indicate an error by calling `on_io_open_complete` with `IO_OPEN_ERROR` and it shall close the underlying IOs. **]** |
| 191 |
**SRS_HEADER_DETECT_IO_01_059: [** When `on_underlying_io_error` is called while OPEN, the error should be indicated to the consumer by calling `on_io_error` and passing the `on_io_error_context` to it. **]** |
| 192 |
|
| 193 |
### on_underlying_io_bytes_received |
| 194 |
|
| 195 |
```C |
| 196 |
void on_underlying_io_bytes_received(void* context, const unsigned char* buffer, size_t size) |
| 197 |
``` |
| 198 |
|
| 199 |
**SRS_HEADER_DETECT_IO_01_050: [** If `context` is NULL, `on_underlying_io_bytes_received` shall do nothing. **]** |
| 200 |
**SRS_HEADER_DETECT_IO_01_049: [** When `on_underlying_io_bytes_received` is called while opening the underlying IO (before the underlying open complete is received), an error shall be indicated by calling `on_io_open_complete` with `IO_OPEN_ERROR`. **]** |
| 201 |
**SRS_HEADER_DETECT_IO_01_051: [** If `buffer` is NULL or `size` is 0 while the IO is OPEN an error shall be indicated by calling `on_io_error`. **]** |
| 202 |
**SRS_HEADER_DETECT_IO_01_067: [** When `on_underlying_io_bytes_received` is called while waiting for header bytes (after the underlying IO was open), the bytes shall be matched against the entries provided in the configuration passed to `header_detect_io_create`. **]** |
| 203 |
**SRS_HEADER_DETECT_IO_01_068: [** Header bytes shall be accepted in multiple `on_underlying_io_bytes_received` calls. **]** |
| 204 |
**SRS_HEADER_DETECT_IO_01_066: [** If the bytes received since matching started do not match any of the headers in the `header_detect_entries` field, then the IO shall be considered not open and an open complete with `IO_OPEN_ERROR` shall be indicated. **]** |
| 205 |
**SRS_HEADER_DETECT_IO_01_069: [** If a header match was detected on an entry with a non-NULL io handle, a new IO associated shall be created by calling `xio_create`. **]** This IO is referenced as the detected IO in subsequent requirements. |
| 206 |
**SRS_HEADER_DETECT_IO_01_073: [** The interface description passed to `xio_create` shall be the interface description associated with the detected header. **]** |
| 207 |
**SRS_HEADER_DETECT_IO_01_074: [** The IO create parameters shall be a `SERVER_PROTOCOL_IO_CONFIG` structure. **]** |
| 208 |
**SRS_HEADER_DETECT_IO_01_075: [** The underlying IO in the `SERVER_PROTOCOL_IO_CONFIG` structure shall be set to the last detected IO that was created if any. **]** |
| 209 |
**SRS_HEADER_DETECT_IO_01_076: [** If no detected IO was created then the underlying IO in the `SERVER_PROTOCOL_IO_CONFIG` structure shall be set to the `underlying_io` passed in the create arguments. **]** |
| 210 |
**SRS_HEADER_DETECT_IO_01_077: [** If `xio_create` fails the header detect IO shall be closed and an error shall be indicated by calling `on_io_open_complete` with `IO_OPEN_ERROR`. **]** |
| 211 |
**SRS_HEADER_DETECT_IO_01_078: [** The newly create IO shall be open by calling `xio_open`. **]** |
| 212 |
**SRS_HEADER_DETECT_IO_01_079: [** The `on_io_open_complete` callback passed to `xio_open` shall be `on_underlying_io_open_complete`. **]** |
| 213 |
**SRS_HEADER_DETECT_IO_01_080: [** The `on_bytes_received` callback passed to `xio_open` shall be `on_underlying_io_bytes_received`. **]** |
| 214 |
**SRS_HEADER_DETECT_IO_01_081: [** The `on_io_error` callback passed to `xio_open` shall be `on_underlying_io_error`. **]** |
| 215 |
**SRS_HEADER_DETECT_IO_01_082: [** If `xio_open` fails the header detect IO shall be closed and an error shall be indicated by calling `on_io_open_complete` with `IO_OPEN_ERROR`. **]** |
| 216 |
**SRS_HEADER_DETECT_IO_01_083: [** The header detect IO shall wait for opening of the detected IO (signaled by the `on_underlying_io_open_complete`). **]** |
| 217 |
**SRS_HEADER_DETECT_IO_01_085: [** If the received bytes were only partially consumed for header detection, all the remaining bytes shall be used as if they were indicated as received in a subsequent call to `on_underlying_io_bytes_received`. **]** |
| 218 |
**SRS_HEADER_DETECT_IO_01_086: [** The newly created IO shall be added to the chain of IOs by calling `singlylinkedlist_add`. **]** |
| 219 |
**SRS_HEADER_DETECT_IO_01_084: [** If `singlylinkedlist_add` fails the newly created IO shall be destroyed and an error shall be indicated by calling `on_io_open_complete` with `IO_OPEN_ERROR`. **]** |
| 220 |
**SRS_HEADER_DETECT_IO_01_087: [** If `on_underlying_io_bytes_received` is called while waiting for the detected IO to complete its open, the bytes shall be given to the last created IO by calling its `on_bytes_received` callback that was filled into the `on_bytes_received` member of `SERVER_PROTOCOL_IO_CONFIG`. **]** |
| 221 |
**SRS_HEADER_DETECT_IO_01_089: [** If `on_underlying_io_bytes_received` is called while header detect IO is OPEN the bytes shall be given to the user via the `on_bytes_received` callback that was the `on_bytes_received` callback passed to `header_detect_io_open_async`. **]** |
| 222 |
**SRS_HEADER_DETECT_IO_01_090: [** If no detected IOs were created and `on_underlying_io_bytes_received` is called while header detect IO is OPEN, the `on_bytes_received` callback passed to `header_detect_io_open_async` shall be called to indicate the bytes as received. **]** |
| 223 |
|
| 224 |
### on_underlying_io_bytes_received |
| 225 |
|
| 226 |
```C |
| 227 |
MOCKABLE_FUNCTION(, const AMQP_HEADER, header_detect_io_get_amqp_header); |
| 228 |
``` |
| 229 |
|
| 230 |
**SRS_HEADER_DETECT_IO_01_091: [** `header_detect_io_get_amqp_header` shall return a structure that should point to a buffer that contains the bytes { 'A', 'M', 'Q', 'P', 0, 1, 0, 0 }. **]** |
| 231 |
|
| 232 |
```C |
| 233 |
MOCKABLE_FUNCTION(, const AMQP_HEADER, header_detect_io_get_sasl_amqp_header); |
| 234 |
``` |
| 235 |
|
| 236 |
**SRS_HEADER_DETECT_IO_01_091: [** `header_detect_io_get_sasl_amqp_header` shall return a structure that should point to a buffer that contains the bytes { 'A', 'M', 'Q', 'P', 3, 1, 0, 0 }. **]** |
| 237 |
|
| 238 |
### header_detect_io_get_interface_description |
| 239 |
|
| 240 |
```c |
| 241 |
MOCKABLE_FUNCTION(, const IO_INTERFACE_DESCRIPTION*, header_detect_io_get_interface_description); |
| 242 |
``` |
| 243 |
|
| 244 |
**SRS_HEADER_DETECT_IO_01_096: [** `header_detect_io_get_interface_description` shall return a pointer to an `IO_INTERFACE_DESCRIPTION` structure that contains pointers to the functions: `header_detect_io_retrieve_options`, `header_detect_io_retrieve_create`, `header_detect_io_destroy`, `header_detect_io_open`, `header_detect_io_close`, `header_detect_io_send` and `header_detect_io_dowork`. **]** |