Commit 63c4a90e authored by Robert Schmidt's avatar Robert Schmidt

Remove unused PROTO_AGENT code

parent 8c0ebfad
...@@ -41,46 +41,6 @@ proto_agent_channel_t *proto_channel[NUM_MAX_ENB][ENB_AGENT_MAX]; ...@@ -41,46 +41,6 @@ proto_agent_channel_t *proto_channel[NUM_MAX_ENB][ENB_AGENT_MAX];
proto_agent_channel_instance_t channel_instance; proto_agent_channel_instance_t channel_instance;
int proto_agent_channel_id = 0; int proto_agent_channel_id = 0;
int proto_agent_msg_send(mod_id_t mod_id, proto_agent_id_t agent_id, void *data, int size, int priority) {
/*Check if agent id is valid*/
if (agent_id >= ENB_AGENT_MAX || agent_id < 0) {
goto error;
}
proto_agent_channel_t *channel;
channel = proto_channel[mod_id][agent_id];
/*Check if agent has a channel registered*/
if (channel == NULL) {
goto error;
}
return channel->msg_send(data, size, priority, channel->channel_info);
error:
LOG_E(PROTO_AGENT, "No channel registered for agent with id %d\n", agent_id);
return -1;
}
int proto_agent_msg_recv(mod_id_t mod_id, proto_agent_id_t agent_id, void **data, int *size, int *priority) {
/*Check if agent id is valid*/
if (agent_id >= ENB_AGENT_MAX || agent_id < 0) {
goto error;
}
proto_agent_channel_t *channel;
channel = proto_channel[mod_id][agent_id];
/*Check if agent has a channel registered*/
if (channel == NULL) {
goto error;
}
return channel->msg_recv(data, size, priority, channel->channel_info);
error:
LOG_E(PROTO_AGENT, "No channel registered for agent with id %d\n", agent_id);
return -1;
}
int proto_agent_register_channel(mod_id_t mod_id, proto_agent_channel_t *channel, proto_agent_id_t agent_id) { int proto_agent_register_channel(mod_id_t mod_id, proto_agent_channel_t *channel, proto_agent_id_t agent_id) {
int i; int i;
......
...@@ -59,10 +59,6 @@ typedef struct proto_agent_channel_instance_s{ ...@@ -59,10 +59,6 @@ typedef struct proto_agent_channel_instance_s{
RB_HEAD(proto_agent_channel_map, proto_agent_channel_s) proto_agent_head; RB_HEAD(proto_agent_channel_map, proto_agent_channel_s) proto_agent_head;
} proto_agent_channel_instance_t; } proto_agent_channel_instance_t;
/*Send and receive messages using the channel registered for a specific agent*/
int proto_agent_msg_send(mod_id_t mod_id, proto_agent_id_t agent_id, void *data, int size, int priority);
int proto_agent_msg_recv(mod_id_t mod_id, proto_agent_id_t agent_id, void **data, int *size, int *priority);
/*Register a channel to an agent. Use ENB_AGENT_MAX to register the /*Register a channel to an agent. Use ENB_AGENT_MAX to register the
*same channel to all agents*/ *same channel to all agents*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment