change some parameters in the library to meet the needs of the website httpbin.org
Fork of MiniTLS-GPL by
core/buffer_network.h@0:35aa5be3b78d, 2014-06-06 (annotated)
- Committer:
- MiniTLS
- Date:
- Fri Jun 06 10:49:02 2014 +0000
- Revision:
- 0:35aa5be3b78d
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MiniTLS | 0:35aa5be3b78d | 1 | /* |
MiniTLS | 0:35aa5be3b78d | 2 | MuTLS - A super trimmed down TLS/SSL Library for embedded devices |
MiniTLS | 0:35aa5be3b78d | 3 | Author: Donatien Garnier |
MiniTLS | 0:35aa5be3b78d | 4 | Copyright (C) 2013-2014 AppNearMe Ltd |
MiniTLS | 0:35aa5be3b78d | 5 | |
MiniTLS | 0:35aa5be3b78d | 6 | This program is free software; you can redistribute it and/or |
MiniTLS | 0:35aa5be3b78d | 7 | modify it under the terms of the GNU General Public License |
MiniTLS | 0:35aa5be3b78d | 8 | as published by the Free Software Foundation; either version 2 |
MiniTLS | 0:35aa5be3b78d | 9 | of the License, or (at your option) any later version. |
MiniTLS | 0:35aa5be3b78d | 10 | |
MiniTLS | 0:35aa5be3b78d | 11 | This program is distributed in the hope that it will be useful, |
MiniTLS | 0:35aa5be3b78d | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
MiniTLS | 0:35aa5be3b78d | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MiniTLS | 0:35aa5be3b78d | 14 | GNU General Public License for more details. |
MiniTLS | 0:35aa5be3b78d | 15 | |
MiniTLS | 0:35aa5be3b78d | 16 | You should have received a copy of the GNU General Public License |
MiniTLS | 0:35aa5be3b78d | 17 | along with this program; if not, write to the Free Software |
MiniTLS | 0:35aa5be3b78d | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
MiniTLS | 0:35aa5be3b78d | 19 | *//** |
MiniTLS | 0:35aa5be3b78d | 20 | * \file buffer_network.h |
MiniTLS | 0:35aa5be3b78d | 21 | * \copyright Copyright (c) AppNearMe Ltd 2013 |
MiniTLS | 0:35aa5be3b78d | 22 | * \author Donatien Garnier |
MiniTLS | 0:35aa5be3b78d | 23 | */ |
MiniTLS | 0:35aa5be3b78d | 24 | |
MiniTLS | 0:35aa5be3b78d | 25 | #ifndef BUFFER_NETWORK_H_ |
MiniTLS | 0:35aa5be3b78d | 26 | #define BUFFER_NETWORK_H_ |
MiniTLS | 0:35aa5be3b78d | 27 | |
MiniTLS | 0:35aa5be3b78d | 28 | #ifdef __cplusplus |
MiniTLS | 0:35aa5be3b78d | 29 | extern "C" { |
MiniTLS | 0:35aa5be3b78d | 30 | #endif |
MiniTLS | 0:35aa5be3b78d | 31 | |
MiniTLS | 0:35aa5be3b78d | 32 | #include "core/fwk.h" |
MiniTLS | 0:35aa5be3b78d | 33 | |
MiniTLS | 0:35aa5be3b78d | 34 | //Helpers for buffers in Big Endian format |
MiniTLS | 0:35aa5be3b78d | 35 | |
MiniTLS | 0:35aa5be3b78d | 36 | uint8_t buffer_nu8_read(buffer_t* buffer); |
MiniTLS | 0:35aa5be3b78d | 37 | uint16_t buffer_nu16_read(buffer_t* buffer); |
MiniTLS | 0:35aa5be3b78d | 38 | uint32_t buffer_nu24_read(buffer_t* buffer); |
MiniTLS | 0:35aa5be3b78d | 39 | uint32_t buffer_nu32_read(buffer_t* buffer); |
MiniTLS | 0:35aa5be3b78d | 40 | uint64_t buffer_nu64_read(buffer_t* buffer); |
MiniTLS | 0:35aa5be3b78d | 41 | void buffer_nbytes_read(buffer_t* buffer, uint8_t* data, size_t size); |
MiniTLS | 0:35aa5be3b78d | 42 | void buffer_n_discard(buffer_t* buffer, size_t size); |
MiniTLS | 0:35aa5be3b78d | 43 | uint8_t* buffer_current_read_position(buffer_t* buffer); |
MiniTLS | 0:35aa5be3b78d | 44 | size_t buffer_get_read_offset(buffer_t* buffer); |
MiniTLS | 0:35aa5be3b78d | 45 | void buffer_set_read_offset(buffer_t* buffer, size_t off); |
MiniTLS | 0:35aa5be3b78d | 46 | |
MiniTLS | 0:35aa5be3b78d | 47 | void buffer_nu8_write(buffer_t* buffer, uint8_t hu8); |
MiniTLS | 0:35aa5be3b78d | 48 | void buffer_nu16_write(buffer_t* buffer, uint16_t hu16); |
MiniTLS | 0:35aa5be3b78d | 49 | void buffer_nu24_write(buffer_t* buffer, uint32_t hu24); |
MiniTLS | 0:35aa5be3b78d | 50 | void buffer_nu32_write(buffer_t* buffer, uint32_t hu32); |
MiniTLS | 0:35aa5be3b78d | 51 | void buffer_nu64_write(buffer_t* buffer, uint64_t hu64); |
MiniTLS | 0:35aa5be3b78d | 52 | void buffer_nbytes_write(buffer_t* buffer, const uint8_t* data, size_t size); |
MiniTLS | 0:35aa5be3b78d | 53 | void buffer_n_skip(buffer_t* buffer, size_t size); |
MiniTLS | 0:35aa5be3b78d | 54 | uint8_t* buffer_current_write_position(buffer_t* buffer); |
MiniTLS | 0:35aa5be3b78d | 55 | |
MiniTLS | 0:35aa5be3b78d | 56 | #ifdef __cplusplus |
MiniTLS | 0:35aa5be3b78d | 57 | } |
MiniTLS | 0:35aa5be3b78d | 58 | #endif |
MiniTLS | 0:35aa5be3b78d | 59 | |
MiniTLS | 0:35aa5be3b78d | 60 | #endif /* BUFFER_NETWORK_H_ */ |