aboutsummaryrefslogtreecommitdiffstats
path: root/gg_map
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-12-11 13:09:00 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-12-11 13:09:00 +0100
commit5f9f1de84daab9627a5168b4d2601c7b196c941f (patch)
tree85a7ff2ea3c53e10becaf577adf466a7617d5cb7 /gg_map
parentdefine constant for size factor ratio for the packet size (diff)
downloadglouglou-5f9f1de84daab9627a5168b4d2601c7b196c941f.tar.xz
glouglou-5f9f1de84daab9627a5168b4d2601c7b196c941f.zip
correctly decode packet size and response type
Diffstat (limited to 'gg_map')
-rw-r--r--gg_map/gg_map.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gg_map/gg_map.c b/gg_map/gg_map.c
index b89e57b..d91859f 100644
--- a/gg_map/gg_map.c
+++ b/gg_map/gg_map.c
@@ -91,17 +91,24 @@ _conn_del(int id) {
}
static void
-_conn_data(int id, int size) {
+_conn_data(int id, u_int8_t size) {
struct ggnet_conn *conn;
- Egraph_Vertice *a, *b;
+ Egraph_Vertice *a, *b, *tmp;
+ int response;
conn = ggnet_conn_find_by_id(_ggnet, id);
if (!conn)
return;
+ response = size >> 7;
+ size = size & 0xe;
+
a = ggnet_node_usrdata_get(ggnet_conn_src_get(conn));
b = ggnet_node_usrdata_get(ggnet_conn_dst_get(conn));
- egraph_vertice_send_blob(_egraph, a, b, 8, 0xFF000000);
+ if (response) {
+ tmp = a; a = b; b = tmp;
+ }
+ egraph_vertice_send_blob(_egraph, a, b, 8 + size * 2, 0xFF000000);
}
int