| 1 |
#ifndef AWS_EVENT_STREAM_H_ |
| 2 |
#define AWS_EVENT_STREAM_H_ |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#include <aws/common/array_list.h> |
| 10 |
#include <aws/common/byte_buf.h> |
| 11 |
#include <aws/common/logging.h> |
| 12 |
#include <aws/event-stream/event_stream_exports.h> |
| 13 |
|
| 14 |
#include <stdio.h> |
| 15 |
|
| 16 |
AWS_PUSH_SANE_WARNING_LEVEL |
| 17 |
|
| 18 |
#define AWS_C_EVENT_STREAM_PACKAGE_ID 4 |
| 19 |
|
| 20 |
|
| 21 |
#define AWS_EVENT_STREAM_MAX_MESSAGE_SIZE (24 * 1024 * 1024) |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
#define AWS_EVENT_STREAM_MAX_HEADERS_SIZE (AWS_EVENT_STREAM_MAX_MESSAGE_SIZE) |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
#define AWS_EVENT_STREAM_HEADER_NAME_LEN_MAX (UINT8_MAX) |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
#define AWS_EVENT_STREAM_HEADER_VALUE_LEN_MAX (INT16_MAX) |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
#define AWS_EVENT_STREAM_MESSAGE_MAX_HEADERS 1024 |
| 41 |
|
| 42 |
enum aws_event_stream_errors { |
| 43 |
AWS_ERROR_EVENT_STREAM_BUFFER_LENGTH_MISMATCH = AWS_ERROR_ENUM_BEGIN_RANGE(AWS_C_EVENT_STREAM_PACKAGE_ID), |
| 44 |
AWS_ERROR_EVENT_STREAM_INSUFFICIENT_BUFFER_LEN, |
| 45 |
AWS_ERROR_EVENT_STREAM_MESSAGE_FIELD_SIZE_EXCEEDED, |
| 46 |
AWS_ERROR_EVENT_STREAM_PRELUDE_CHECKSUM_FAILURE, |
| 47 |
AWS_ERROR_EVENT_STREAM_MESSAGE_CHECKSUM_FAILURE, |
| 48 |
AWS_ERROR_EVENT_STREAM_MESSAGE_INVALID_HEADERS_LEN, |
| 49 |
AWS_ERROR_EVENT_STREAM_MESSAGE_UNKNOWN_HEADER_TYPE, |
| 50 |
AWS_ERROR_EVENT_STREAM_MESSAGE_PARSER_ILLEGAL_STATE, |
| 51 |
AWS_ERROR_EVENT_STREAM_RPC_CONNECTION_CLOSED, |
| 52 |
AWS_ERROR_EVENT_STREAM_RPC_PROTOCOL_ERROR, |
| 53 |
AWS_ERROR_EVENT_STREAM_RPC_STREAM_CLOSED, |
| 54 |
AWS_ERROR_EVENT_STREAM_RPC_STREAM_NOT_ACTIVATED, |
| 55 |
AWS_ERROR_EVENT_STREAM_MESSAGE_TOO_MANY_HEADERS, |
| 56 |
|
| 57 |
AWS_ERROR_EVENT_STREAM_END_RANGE = AWS_ERROR_ENUM_END_RANGE(AWS_C_EVENT_STREAM_PACKAGE_ID), |
| 58 |
}; |
| 59 |
|
| 60 |
enum aws_event_stream_log_subject { |
| 61 |
AWS_LS_EVENT_STREAM_GENERAL = AWS_LOG_SUBJECT_BEGIN_RANGE(AWS_C_EVENT_STREAM_PACKAGE_ID), |
| 62 |
AWS_LS_EVENT_STREAM_CHANNEL_HANDLER, |
| 63 |
AWS_LS_EVENT_STREAM_RPC_SERVER, |
| 64 |
AWS_LS_EVENT_STREAM_RPC_CLIENT, |
| 65 |
|
| 66 |
AWS_LS_EVENT_STREAM_LAST = AWS_LOG_SUBJECT_END_RANGE(AWS_C_EVENT_STREAM_PACKAGE_ID), |
| 67 |
}; |
| 68 |
|
| 69 |
struct aws_event_stream_message_prelude { |
| 70 |
uint32_t total_len; |
| 71 |
uint32_t headers_len; |
| 72 |
uint32_t prelude_crc; |
| 73 |
}; |
| 74 |
|
| 75 |
struct aws_event_stream_message { |
| 76 |
struct aws_allocator *alloc; |
| 77 |
struct aws_byte_buf message_buffer; |
| 78 |
}; |
| 79 |
|
| 80 |
|
| 81 |
#define AWS_EVENT_STREAM_PRELUDE_LENGTH (uint32_t)(12) |
| 82 |
|
| 83 |
|
| 84 |
#define AWS_EVENT_STREAM_TRAILER_LENGTH (uint32_t)(4) |
| 85 |
|
| 86 |
enum aws_event_stream_header_value_type { |
| 87 |
AWS_EVENT_STREAM_HEADER_BOOL_TRUE = 0, |
| 88 |
AWS_EVENT_STREAM_HEADER_BOOL_FALSE, |
| 89 |
AWS_EVENT_STREAM_HEADER_BYTE, |
| 90 |
AWS_EVENT_STREAM_HEADER_INT16, |
| 91 |
AWS_EVENT_STREAM_HEADER_INT32, |
| 92 |
AWS_EVENT_STREAM_HEADER_INT64, |
| 93 |
AWS_EVENT_STREAM_HEADER_BYTE_BUF, |
| 94 |
AWS_EVENT_STREAM_HEADER_STRING, |
| 95 |
|
| 96 |
AWS_EVENT_STREAM_HEADER_TIMESTAMP, |
| 97 |
AWS_EVENT_STREAM_HEADER_UUID |
| 98 |
}; |
| 99 |
|
| 100 |
struct aws_event_stream_header_value_pair { |
| 101 |
uint8_t header_name_len; |
| 102 |
char header_name[AWS_EVENT_STREAM_HEADER_NAME_LEN_MAX]; |
| 103 |
enum aws_event_stream_header_value_type header_value_type; |
| 104 |
union { |
| 105 |
uint8_t *variable_len_val; |
| 106 |
uint8_t static_val[16]; |
| 107 |
} header_value; |
| 108 |
|
| 109 |
uint16_t header_value_len; |
| 110 |
int8_t value_owned; |
| 111 |
}; |
| 112 |
|
| 113 |
struct aws_event_stream_streaming_decoder; |
| 114 |
typedef int(aws_event_stream_process_state_fn)( |
| 115 |
struct aws_event_stream_streaming_decoder *decoder, |
| 116 |
const uint8_t *data, |
| 117 |
size_t len, |
| 118 |
size_t *processed); |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
typedef void(aws_event_stream_process_on_payload_segment_fn)( |
| 126 |
struct aws_event_stream_streaming_decoder *decoder, |
| 127 |
struct aws_byte_buf *payload, |
| 128 |
int8_t final_segment, |
| 129 |
void *user_data); |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
typedef void(aws_event_stream_prelude_received_fn)( |
| 136 |
struct aws_event_stream_streaming_decoder *decoder, |
| 137 |
struct aws_event_stream_message_prelude *prelude, |
| 138 |
void *user_data); |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
typedef void(aws_event_stream_header_received_fn)( |
| 145 |
struct aws_event_stream_streaming_decoder *decoder, |
| 146 |
struct aws_event_stream_message_prelude *prelude, |
| 147 |
struct aws_event_stream_header_value_pair *header, |
| 148 |
void *user_data); |
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
typedef void(aws_event_stream_on_complete_fn)( |
| 155 |
struct aws_event_stream_streaming_decoder *decoder, |
| 156 |
uint32_t message_crc, |
| 157 |
void *user_data); |
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
typedef void(aws_event_stream_on_error_fn)( |
| 164 |
struct aws_event_stream_streaming_decoder *decoder, |
| 165 |
struct aws_event_stream_message_prelude *prelude, |
| 166 |
int error_code, |
| 167 |
const char *message, |
| 168 |
void *user_data); |
| 169 |
|
| 170 |
struct aws_event_stream_streaming_decoder { |
| 171 |
struct aws_allocator *alloc; |
| 172 |
uint8_t working_buffer[AWS_EVENT_STREAM_PRELUDE_LENGTH]; |
| 173 |
size_t message_pos; |
| 174 |
uint32_t running_crc; |
| 175 |
size_t current_header_name_offset; |
| 176 |
size_t current_header_value_offset; |
| 177 |
struct aws_event_stream_header_value_pair current_header; |
| 178 |
struct aws_event_stream_message_prelude prelude; |
| 179 |
aws_event_stream_process_state_fn *state; |
| 180 |
aws_event_stream_process_on_payload_segment_fn *on_payload; |
| 181 |
aws_event_stream_prelude_received_fn *on_prelude; |
| 182 |
aws_event_stream_header_received_fn *on_header; |
| 183 |
aws_event_stream_on_complete_fn *on_complete; |
| 184 |
aws_event_stream_on_error_fn *on_error; |
| 185 |
void *user_context; |
| 186 |
}; |
| 187 |
|
| 188 |
struct aws_event_stream_streaming_decoder_options { |
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
aws_event_stream_process_on_payload_segment_fn *on_payload_segment; |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
aws_event_stream_prelude_received_fn *on_prelude; |
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
aws_event_stream_header_received_fn *on_header; |
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
aws_event_stream_on_complete_fn *on_complete; |
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
aws_event_stream_on_error_fn *on_error; |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
void *user_data; |
| 224 |
}; |
| 225 |
AWS_EXTERN_C_BEGIN |
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
AWS_EVENT_STREAM_API int aws_event_stream_message_init( |
| 233 |
struct aws_event_stream_message *message, |
| 234 |
struct aws_allocator *alloc, |
| 235 |
const struct aws_array_list *headers, |
| 236 |
const struct aws_byte_buf *payload); |
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
AWS_EVENT_STREAM_API int aws_event_stream_message_from_buffer( |
| 243 |
struct aws_event_stream_message *message, |
| 244 |
struct aws_allocator *alloc, |
| 245 |
struct aws_byte_buf *buffer); |
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
AWS_EVENT_STREAM_API int aws_event_stream_message_from_buffer_copy( |
| 252 |
struct aws_event_stream_message *message, |
| 253 |
struct aws_allocator *alloc, |
| 254 |
const struct aws_byte_buf *buffer); |
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
AWS_EVENT_STREAM_API void aws_event_stream_message_clean_up(struct aws_event_stream_message *message); |
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
AWS_EVENT_STREAM_API uint32_t aws_event_stream_message_total_length(const struct aws_event_stream_message *message); |
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
AWS_EVENT_STREAM_API uint32_t aws_event_stream_message_headers_len(const struct aws_event_stream_message *message); |
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
AWS_EVENT_STREAM_API uint32_t aws_event_stream_message_prelude_crc(const struct aws_event_stream_message *message); |
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
AWS_EVENT_STREAM_API int aws_event_stream_message_to_debug_str( |
| 281 |
FILE *fd, |
| 282 |
const struct aws_event_stream_message *message); |
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
AWS_EVENT_STREAM_API int aws_event_stream_message_headers( |
| 289 |
const struct aws_event_stream_message *message, |
| 290 |
struct aws_array_list *headers); |
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
AWS_EVENT_STREAM_API const uint8_t *aws_event_stream_message_payload(const struct aws_event_stream_message *message); |
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
AWS_EVENT_STREAM_API uint32_t aws_event_stream_message_payload_len(const struct aws_event_stream_message *message); |
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
AWS_EVENT_STREAM_API uint32_t aws_event_stream_message_message_crc(const struct aws_event_stream_message *message); |
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
AWS_EVENT_STREAM_API const uint8_t *aws_event_stream_message_buffer(const struct aws_event_stream_message *message); |
| 311 |
|
| 312 |
AWS_EVENT_STREAM_API uint32_t |
| 313 |
aws_event_stream_compute_headers_required_buffer_len(const struct aws_array_list *headers); |
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
AWS_EVENT_STREAM_API int aws_event_stream_write_headers_to_buffer_safe( |
| 322 |
const struct aws_array_list *headers, |
| 323 |
struct aws_byte_buf *buf); |
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
AWS_EVENT_STREAM_API size_t |
| 332 |
aws_event_stream_write_headers_to_buffer(const struct aws_array_list *headers, uint8_t *buffer); |
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
AWS_EVENT_STREAM_API int aws_event_stream_read_headers_from_buffer( |
| 340 |
struct aws_array_list *headers, |
| 341 |
const uint8_t *buffer, |
| 342 |
size_t headers_len); |
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
AWS_EVENT_STREAM_API |
| 349 |
void aws_event_stream_streaming_decoder_init_from_options( |
| 350 |
struct aws_event_stream_streaming_decoder *decoder, |
| 351 |
struct aws_allocator *allocator, |
| 352 |
const struct aws_event_stream_streaming_decoder_options *options); |
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
AWS_EVENT_STREAM_API void aws_event_stream_streaming_decoder_init( |
| 359 |
struct aws_event_stream_streaming_decoder *decoder, |
| 360 |
struct aws_allocator *alloc, |
| 361 |
aws_event_stream_process_on_payload_segment_fn *on_payload_segment, |
| 362 |
aws_event_stream_prelude_received_fn *on_prelude, |
| 363 |
aws_event_stream_header_received_fn *on_header, |
| 364 |
aws_event_stream_on_error_fn *on_error, |
| 365 |
void *user_data); |
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
AWS_EVENT_STREAM_API void aws_event_stream_streaming_decoder_clean_up( |
| 372 |
struct aws_event_stream_streaming_decoder *decoder); |
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
AWS_EVENT_STREAM_API int aws_event_stream_headers_list_init( |
| 378 |
struct aws_array_list *headers, |
| 379 |
struct aws_allocator *allocator); |
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
AWS_EVENT_STREAM_API void aws_event_stream_headers_list_cleanup(struct aws_array_list *headers); |
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
AWS_EVENT_STREAM_API int aws_event_stream_add_string_header( |
| 391 |
struct aws_array_list *headers, |
| 392 |
const char *name, |
| 393 |
uint8_t name_len, |
| 394 |
const char *value, |
| 395 |
uint16_t value_len, |
| 396 |
int8_t copy); |
| 397 |
|
| 398 |
AWS_EVENT_STREAM_API struct aws_event_stream_header_value_pair aws_event_stream_create_string_header( |
| 399 |
struct aws_byte_cursor name, |
| 400 |
struct aws_byte_cursor value); |
| 401 |
|
| 402 |
AWS_EVENT_STREAM_API struct aws_event_stream_header_value_pair aws_event_stream_create_int32_header( |
| 403 |
struct aws_byte_cursor name, |
| 404 |
int32_t value); |
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
AWS_EVENT_STREAM_API int aws_event_stream_add_byte_header( |
| 410 |
struct aws_array_list *headers, |
| 411 |
const char *name, |
| 412 |
uint8_t name_len, |
| 413 |
int8_t value); |
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
|
| 418 |
AWS_EVENT_STREAM_API int aws_event_stream_add_bool_header( |
| 419 |
struct aws_array_list *headers, |
| 420 |
const char *name, |
| 421 |
uint8_t name_len, |
| 422 |
int8_t value); |
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
AWS_EVENT_STREAM_API int aws_event_stream_add_int16_header( |
| 428 |
struct aws_array_list *headers, |
| 429 |
const char *name, |
| 430 |
uint8_t name_len, |
| 431 |
int16_t value); |
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
AWS_EVENT_STREAM_API int aws_event_stream_add_int32_header( |
| 437 |
struct aws_array_list *headers, |
| 438 |
const char *name, |
| 439 |
uint8_t name_len, |
| 440 |
int32_t value); |
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
AWS_EVENT_STREAM_API int aws_event_stream_add_int64_header( |
| 446 |
struct aws_array_list *headers, |
| 447 |
const char *name, |
| 448 |
uint8_t name_len, |
| 449 |
int64_t value); |
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
AWS_EVENT_STREAM_API int aws_event_stream_add_bytebuf_header( |
| 456 |
struct aws_array_list *headers, |
| 457 |
const char *name, |
| 458 |
uint8_t name_len, |
| 459 |
uint8_t *value, |
| 460 |
uint16_t value_len, |
| 461 |
int8_t copy); |
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
AWS_EVENT_STREAM_API int aws_event_stream_add_timestamp_header( |
| 467 |
struct aws_array_list *headers, |
| 468 |
const char *name, |
| 469 |
uint8_t name_len, |
| 470 |
int64_t value); |
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
AWS_EVENT_STREAM_API int aws_event_stream_add_uuid_header( |
| 476 |
struct aws_array_list *headers, |
| 477 |
const char *name, |
| 478 |
uint8_t name_len, |
| 479 |
const uint8_t *value); |
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
AWS_EVENT_STREAM_API int aws_event_stream_add_header( |
| 486 |
struct aws_array_list *headers, |
| 487 |
const struct aws_event_stream_header_value_pair *header); |
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
AWS_EVENT_STREAM_API int aws_event_stream_add_bool_header_by_cursor( |
| 500 |
struct aws_array_list *headers, |
| 501 |
struct aws_byte_cursor name, |
| 502 |
bool value); |
| 503 |
|
| 504 |
|
| 505 |
|
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
AWS_EVENT_STREAM_API int aws_event_stream_add_byte_header_by_cursor( |
| 513 |
struct aws_array_list *headers, |
| 514 |
struct aws_byte_cursor name, |
| 515 |
int8_t value); |
| 516 |
|
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
|
| 524 |
|
| 525 |
AWS_EVENT_STREAM_API int aws_event_stream_add_int16_header_by_cursor( |
| 526 |
struct aws_array_list *headers, |
| 527 |
struct aws_byte_cursor name, |
| 528 |
int16_t value); |
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
|
| 538 |
AWS_EVENT_STREAM_API int aws_event_stream_add_int32_header_by_cursor( |
| 539 |
struct aws_array_list *headers, |
| 540 |
struct aws_byte_cursor name, |
| 541 |
int32_t value); |
| 542 |
|
| 543 |
|
| 544 |
|
| 545 |
|
| 546 |
|
| 547 |
|
| 548 |
|
| 549 |
|
| 550 |
|
| 551 |
AWS_EVENT_STREAM_API int aws_event_stream_add_int64_header_by_cursor( |
| 552 |
struct aws_array_list *headers, |
| 553 |
struct aws_byte_cursor name, |
| 554 |
int64_t value); |
| 555 |
|
| 556 |
|
| 557 |
|
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
AWS_EVENT_STREAM_API int aws_event_stream_add_string_header_by_cursor( |
| 565 |
struct aws_array_list *headers, |
| 566 |
struct aws_byte_cursor name, |
| 567 |
struct aws_byte_cursor value); |
| 568 |
|
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
|
| 576 |
|
| 577 |
AWS_EVENT_STREAM_API int aws_event_stream_add_byte_buf_header_by_cursor( |
| 578 |
struct aws_array_list *headers, |
| 579 |
struct aws_byte_cursor name, |
| 580 |
struct aws_byte_cursor value); |
| 581 |
|
| 582 |
|
| 583 |
|
| 584 |
|
| 585 |
|
| 586 |
|
| 587 |
|
| 588 |
|
| 589 |
|
| 590 |
AWS_EVENT_STREAM_API int aws_event_stream_add_timestamp_header_by_cursor( |
| 591 |
struct aws_array_list *headers, |
| 592 |
struct aws_byte_cursor name, |
| 593 |
int64_t value); |
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
|
| 599 |
|
| 600 |
|
| 601 |
|
| 602 |
|
| 603 |
AWS_EVENT_STREAM_API int aws_event_stream_add_uuid_header_by_cursor( |
| 604 |
struct aws_array_list *headers, |
| 605 |
struct aws_byte_cursor name, |
| 606 |
struct aws_byte_cursor value); |
| 607 |
|
| 608 |
|
| 609 |
|
| 610 |
|
| 611 |
AWS_EVENT_STREAM_API struct aws_byte_buf aws_event_stream_header_name( |
| 612 |
struct aws_event_stream_header_value_pair *header); |
| 613 |
|
| 614 |
|
| 615 |
|
| 616 |
|
| 617 |
AWS_EVENT_STREAM_API struct aws_byte_buf aws_event_stream_header_value_as_string( |
| 618 |
struct aws_event_stream_header_value_pair *header); |
| 619 |
|
| 620 |
|
| 621 |
|
| 622 |
|
| 623 |
AWS_EVENT_STREAM_API int8_t aws_event_stream_header_value_as_byte(struct aws_event_stream_header_value_pair *header); |
| 624 |
|
| 625 |
|
| 626 |
|
| 627 |
|
| 628 |
AWS_EVENT_STREAM_API int8_t aws_event_stream_header_value_as_bool(struct aws_event_stream_header_value_pair *header); |
| 629 |
|
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
AWS_EVENT_STREAM_API int16_t aws_event_stream_header_value_as_int16(struct aws_event_stream_header_value_pair *header); |
| 634 |
|
| 635 |
|
| 636 |
|
| 637 |
|
| 638 |
AWS_EVENT_STREAM_API int32_t aws_event_stream_header_value_as_int32(struct aws_event_stream_header_value_pair *header); |
| 639 |
|
| 640 |
|
| 641 |
|
| 642 |
|
| 643 |
AWS_EVENT_STREAM_API int64_t aws_event_stream_header_value_as_int64(struct aws_event_stream_header_value_pair *header); |
| 644 |
|
| 645 |
|
| 646 |
|
| 647 |
|
| 648 |
|
| 649 |
AWS_EVENT_STREAM_API struct aws_byte_buf aws_event_stream_header_value_as_bytebuf( |
| 650 |
struct aws_event_stream_header_value_pair *header); |
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
|
| 655 |
AWS_EVENT_STREAM_API int64_t |
| 656 |
aws_event_stream_header_value_as_timestamp(struct aws_event_stream_header_value_pair *header); |
| 657 |
|
| 658 |
|
| 659 |
|
| 660 |
|
| 661 |
AWS_EVENT_STREAM_API struct aws_byte_buf aws_event_stream_header_value_as_uuid( |
| 662 |
struct aws_event_stream_header_value_pair *header); |
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
AWS_EVENT_STREAM_API uint16_t aws_event_stream_header_value_length(struct aws_event_stream_header_value_pair *header); |
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
|
| 673 |
AWS_EVENT_STREAM_API int aws_event_stream_streaming_decoder_pump( |
| 674 |
struct aws_event_stream_streaming_decoder *decoder, |
| 675 |
const struct aws_byte_buf *data); |
| 676 |
|
| 677 |
|
| 678 |
|
| 679 |
|
| 680 |
|
| 681 |
AWS_EVENT_STREAM_API void aws_event_stream_library_init(struct aws_allocator *allocator); |
| 682 |
|
| 683 |
|
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
AWS_EVENT_STREAM_API void aws_event_stream_library_clean_up(void); |
| 688 |
|
| 689 |
AWS_EXTERN_C_END |
| 690 |
AWS_POP_SANE_WARNING_LEVEL |
| 691 |
|
| 692 |
#endif |