Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sol-flow-inspector.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Soletta (TM) Project
3  *
4  * Copyright (C) 2015 Intel Corporation. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #pragma once
20 
21 #include <stdint.h>
22 
23 #include "sol-flow-packet.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
49 typedef struct sol_flow_inspector {
50 #ifndef SOL_NO_API_VERSION
51  uint16_t api_version;
52 #define SOL_FLOW_INSPECTOR_API_VERSION (1)
53 #endif
54 
61  void (*did_open_node)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *node, const struct sol_flow_node_options *options);
62 
69  void (*will_close_node)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *node);
70 
85  void (*did_connect_port)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *src_node, uint16_t src_port, uint16_t src_conn_id, const struct sol_flow_node *dst_node, uint16_t dst_port, uint16_t dst_conn_id);
86 
98  void (*will_disconnect_port)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *src_node, uint16_t src_port, uint16_t src_conn_id, const struct sol_flow_node *dst_node, uint16_t dst_port, uint16_t dst_conn_id);
99 
108  void (*will_send_packet)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *src_node, uint16_t src_port, const struct sol_flow_packet *packet);
109 
119  void (*will_deliver_packet)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *dst_node, uint16_t dst_port, uint16_t dst_conn_id, const struct sol_flow_packet *packet);
121 
129 bool sol_flow_set_inspector(const struct sol_flow_inspector *inspector);
130 
135 #ifdef __cplusplus
136 }
137 #endif
Structure containing a set of inspecting routines.
Definition: sol-flow-inspector.h:49
void(* will_disconnect_port)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *src_node, uint16_t src_port, uint16_t src_conn_id, const struct sol_flow_node *dst_node, uint16_t dst_port, uint16_t dst_conn_id)
Callback to trigger when a connection is terminated.
Definition: sol-flow-inspector.h:98
These routines are used for Soletta flow packets manipulation.
Node options are a set of attributes defined by the Node Type that can change the behavior of a Node...
Definition: sol-flow.h:552
struct sol_flow_node sol_flow_node
A node is an entity that has input/output ports.
Definition: sol-flow.h:71
struct sol_flow_packet sol_flow_packet
A packet is a generic container for different kinds (types) of contents.
Definition: sol-flow-packet.h:54
bool sol_flow_set_inspector(const struct sol_flow_inspector *inspector)
Provide a set of inspecting routines to flow's runtime inspector.
void(* will_send_packet)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *src_node, uint16_t src_port, const struct sol_flow_packet *packet)
Callback to trigger when a packet is about to be sent.
Definition: sol-flow-inspector.h:108
void(* did_open_node)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *node, const struct sol_flow_node_options *options)
Callback to trigger when a node is open.
Definition: sol-flow-inspector.h:61
void(* will_close_node)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *node)
Callback to trigger when a node is about to be closed.
Definition: sol-flow-inspector.h:69
struct sol_flow_inspector sol_flow_inspector
Structure containing a set of inspecting routines.
void(* did_connect_port)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *src_node, uint16_t src_port, uint16_t src_conn_id, const struct sol_flow_node *dst_node, uint16_t dst_port, uint16_t dst_conn_id)
Callback to trigger when a connection between ports is made.
Definition: sol-flow-inspector.h:85
void(* will_deliver_packet)(const struct sol_flow_inspector *inspector, const struct sol_flow_node *dst_node, uint16_t dst_port, uint16_t dst_conn_id, const struct sol_flow_packet *packet)
Callback to trigger when a packet is about to be delivered.
Definition: sol-flow-inspector.h:119
uint16_t api_version
API version.
Definition: sol-flow-inspector.h:51