1 /* Copyright Inspirel Sp. z o.o. 2013-2015.
2 * This file is part of YAMI4.
3 *
4 * YAMI4 is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * YAMI4 is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with YAMI4. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef YAMI4INDUSTRY_CHANNEL_H
19 #define YAMI4INDUSTRY_CHANNEL_H
20
25
26 #include <stddef.h>
27 #include <stdint.h>
28
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif /* __cplusplus */
33
35
37 {
39
41
44
47
52
59
60 /* note: sizes of the arrays below can interact */
61 /* with required padding at the end of struct */
62
64
67 };
68
70
72
74 const char target[]);
75
77 const char target[],
const struct yami_options * options,
79
82
84 uint32_t core_message_id,
85 const uint8_t header[], size_t header_size,
86 const uint8_t body[], size_t body_size);
87
89 const char object_name[], const char message_name[],
90 int64_t message_id, uint32_t core_message_id,
91 const uint8_t body[], size_t body_size);
92
94 int64_t message_id, uint32_t core_message_id,
95 const uint8_t body[], size_t body_size);
96
98 int64_t message_id, uint32_t core_message_id,
99 const char reason[]);
100
103
106
108
111
112 #ifdef __cplusplus
113 }
114 #endif /* __cplusplus */
115
116 #endif /* YAMI4INDUSTRY_CHANNEL_H */
enum yami_protocol protocol_
Definition: channel.h:40
void(* yami_io_error_function)(int32_t error_code, const char description[])
Definition: callbacks.h:81
#define MAX_LENGTH_OF_TARGET_NAME
Definition: limits.h:23
enum yami_result yami_channel_post_message(struct yami_channel *self, const char object_name[], const char message_name[], int64_t message_id, uint32_t core_message_id, const uint8_t body[], size_t body_size)
Definition: channel.c:213
yami_result
Definition: common.h:28
size_t output_data_written_so_far_
Definition: channel.h:50
enum yami_result yami_channel_post_raw_message(struct yami_channel *self, uint32_t core_message_id, const uint8_t header[], size_t header_size, const uint8_t body[], size_t body_size)
Definition: channel.c:120
enum yami_result yami_channel_open(struct yami_channel *self, const char target[], const struct yami_options *options, yami_io_error_function io_error_callback)
Definition: channel.c:66
int32_t socket_ready_for_output_
Definition: channel.h:45
char target_[MAX_LENGTH_OF_TARGET_NAME]
Definition: channel.h:63
#define MAX_OUTGOING_MESSAGE_PAYLOAD
Definition: limits.h:30
int32_t socket_ready_for_input_
Definition: channel.h:46
uint8_t input_buffer_[MAX_INCOMING_MESSAGE_PAYLOAD]
Definition: channel.h:66
int32_t yami_channel_is_open(const struct yami_channel *self)
Definition: channel.c:38
enum yami_result yami_channel_read_some_data(struct yami_channel *self, yami_io_error_function io_error_callback)
Definition: channel.c:551
size_t output_data_size_
Definition: channel.h:49
uint16_t port_
Definition: channel.h:43
#define MAX_INCOMING_MESSAGE_PAYLOAD
Definition: limits.h:33
int32_t yami_channel_name_cmp(const struct yami_channel *self, const char target[])
Definition: channel.c:56
uint32_t input_message_id_
Definition: channel.h:55
size_t input_data_read_so_far_
Definition: channel.h:54
uint8_t output_buffer_[MAX_OUTGOING_MESSAGE_PAYLOAD]
Definition: channel.h:65
size_t input_message_payload_size_
Definition: channel.h:57
enum yami_result yami_channel_post_reject(struct yami_channel *self, int64_t message_id, uint32_t core_message_id, const char reason[])
Definition: channel.c:280
enum yami_result yami_channel_post_reply(struct yami_channel *self, int64_t message_id, uint32_t core_message_id, const uint8_t body[], size_t body_size)
Definition: channel.c:249
enum yami_result yami_channel_write_some_data(struct yami_channel *self, yami_io_error_function io_error_callback)
Definition: channel.c:369
enum yami_result yami_channel_close(struct yami_channel *self, yami_io_error_function io_error_callback)
Definition: channel.c:100
enum yami_result yami_channel_check_udp_packet(struct yami_channel *self)
Definition: channel.c:500
int64_t output_message_id_
Definition: channel.h:51
int32_t socket_
Definition: channel.h:38
int32_t input_message_complete_
Definition: channel.h:58
yami_protocol
Definition: channel.h:34
void yami_channel_clean_input_buffer(struct yami_channel *const self)
Definition: channel.c:493
uint32_t host_
Definition: channel.h:42
void yami_channel_init(struct yami_channel *self)
Definition: channel.c:24
int32_t output_buffer_has_data_
Definition: channel.h:48
size_t input_message_header_size_
Definition: channel.h:56
int32_t input_buffer_has_space_
Definition: channel.h:53