diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2010-12-31 11:49:34 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2010-12-31 11:49:34 (GMT) |
commit | 651c94450df8619c26e26a133289dbaa197616f4 (patch) | |
tree | 1a81a2625687116d205cb5c6583497cb657f8460 /src/debug/packet.c | |
parent | dbec8e8af5f296f0b95cd9c07e7d96b1a4277137 (diff) |
Supported a first basic packet of the Java Debug Wire Protocol.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@204 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/debug/packet.c')
-rw-r--r-- | src/debug/packet.c | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/src/debug/packet.c b/src/debug/packet.c new file mode 100644 index 0000000..9a7df58 --- /dev/null +++ b/src/debug/packet.c @@ -0,0 +1,161 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * packet.c - définition des paquets issus des protocoles de débogage + * + * Copyright (C) 2010 Cyrille Bagard + * + * This file is part of OpenIDA. + * + * OpenIDA is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * OpenIDA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "packet.h" + + +#include "packet-int.h" + + + +/* Initialise la classe des paquets de débogage. */ +static void g_debug_packet_class_init(GDebugPacketClass *); + +/* Initialise une instance de paquet de débogage. */ +static void g_debug_packet_init(GDebugPacket *); + + + +/* Indique le type défini pour un paquet de débogage. */ +G_DEFINE_TYPE(GDebugPacket, g_debug_packet, G_TYPE_OBJECT); + + +/****************************************************************************** +* * +* Paramètres : klass = classe à initialiser. * +* * +* Description : Initialise la classe des paquets de débogage. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_debug_packet_class_init(GDebugPacketClass *klass) +{ + +} + + +/****************************************************************************** +* * +* Paramètres : packet = instance à initialiser. * +* * +* Description : Initialise une instance de paquet de débogage. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_debug_packet_init(GDebugPacket *packet) +{ + DL_LIST_ITEM_INIT(&packet->link); + +} + + +/****************************************************************************** +* * +* Paramètres : packet = instance à convertir. * +* iov = table de vecteurs. [OUT] * +* iovcnt = quantité de champs renseignés. [OUT] * +* * +* Description : Précise les zones mémoires correspondant au contenu. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_debug_packet_vectorize(GDebugPacket *packet, struct iovec iov[UIO_MAXIOV], int *iovcnt) +{ + packet->vectorize(packet, iov, iovcnt); + +} + + +/****************************************************************************** +* * +* Paramètres : list = liste de paquets à consulter. * +* : iter = position actuelle dans la liste. * +* * +* Description : Fournit l'élement suivant un autre pour un parcours. * +* * +* Retour : Elément suivant ou NULL si aucun. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GDebugPacket *g_debug_packet_get_next_iter(const GDebugPacket *list, const GDebugPacket *iter) +{ + GDebugPacket *result; /* Elément suivant à renvoyer */ + + result = dl_list_next_iter(iter, list, GDebugPacket, link); + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : list = liste de paquets à compléter. * +* item = paquet à ajouter à la liste. * +* * +* Description : Ajoute un paquet à une liste de paquets. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_debug_packet_push(GDebugPacket **list, GDebugPacket *item) +{ + dl_list_push(item, list, GDebugPacket, link); + +} + + +/****************************************************************************** +* * +* Paramètres : list = liste de paquets à consulter. * +* * +* Description : Retire et fournit le premier élément d'une liste de paquets. * +* * +* Retour : Elément dépilé de la liste de paquets. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GDebugPacket *g_debug_packet_pop(GDebugPacket **list) +{ + return dl_list_pop(list, GDebugPacket, link); + +} |