twister

HTTP fault injector for testing
Log | Files | Refs | README | LICENSE

twister.h (3039B)


      1 /*
      2      This file is part of GNUnet.
      3      Copyright (C) 2018 Taler Systems SA
      4 
      5      Twister is free software; you can redistribute it and/or
      6      modify it under the terms of the GNU General Public License
      7      as published by the Free Software Foundation; either version
      8      3, or (at your option) any later version.
      9 
     10      Twister is distributed in the hope that it will be useful,
     11      but WITHOUT ANY WARRANTY; without even the implied warranty
     12      of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     13      the GNU General Public License for more details.
     14 
     15      You should have received a copy of the GNU General Public
     16      License along with Twister; see the file COPYING.  If not,
     17      write to the Free Software Foundation, Inc., 51 Franklin
     18      Street, Fifth Floor, Boston, MA 02110-1301, USA.
     19 */
     20 
     21 /**
     22  * @author
     23  * @file twister.h
     24  *
     25  * @brief Common type definitions
     26  */
     27 #ifndef TWISTER_H
     28 #define TWISTER_H
     29 
     30 #include <gnunet/gnunet_common.h>
     31 
     32 #define TWISTER_MESSAGE_TYPE_ACKNOWLEDGEMENT 1
     33 
     34 #define TWISTER_MESSAGE_TYPE_SET_RESPONSE_CODE 2
     35 
     36 #define TWISTER_MESSAGE_TYPE_DELETE_PATH 3
     37 
     38 #define TWISTER_MESSAGE_TYPE_MODIFY_PATH_DL 4
     39 
     40 #define TWISTER_MESSAGE_TYPE_MODIFY_PATH_UL 5
     41 
     42 #define TWISTER_MESSAGE_TYPE_MALFORM 6
     43 
     44 #define TWISTER_MESSAGE_TYPE_MALFORM_UPLOAD 7
     45 
     46 #define TWISTER_MESSAGE_TYPE_FLIP_PATH_DL 8
     47 
     48 #define TWISTER_MESSAGE_TYPE_FLIP_PATH_UL 9
     49 
     50 #define TWISTER_MESSAGE_TYPE_MODIFY_HEADER_DL 10
     51 
     52 GNUNET_NETWORK_STRUCT_BEGIN
     53 struct TWISTER_Malform
     54 {
     55   /**
     56    * Type: #TWISTER_MESSAGE_TYPE_MALFORM
     57    */
     58   struct GNUNET_MessageHeader header;
     59 
     60 };
     61 GNUNET_NETWORK_STRUCT_END
     62 
     63 GNUNET_NETWORK_STRUCT_BEGIN
     64 struct TWISTER_ModifyPath
     65 {
     66   /**
     67    * Type: #TWISTER_MESSAGE_TYPE_DELETE_PATH
     68    */
     69   struct GNUNET_MessageHeader header;
     70 };
     71 GNUNET_NETWORK_STRUCT_END
     72 
     73 
     74 GNUNET_NETWORK_STRUCT_BEGIN
     75 
     76 /**
     77  * Network size estimate sent from the service
     78  * to clients.  Contains the current size estimate
     79  * (or 0 if none has been calculated) and the
     80  * standard deviation of known estimates.
     81  *
     82  */
     83 struct TWISTER_FlipPath
     84 {
     85   /**
     86    * Type: #TWISTER_MESSAGE_TYPE_DELETE_PATH
     87    */
     88   struct GNUNET_MessageHeader header;
     89 };
     90 
     91 GNUNET_NETWORK_STRUCT_END
     92 
     93 
     94 
     95 GNUNET_NETWORK_STRUCT_BEGIN
     96 
     97 /**
     98  * Network size estimate sent from the service
     99  * to clients.  Contains the current size estimate
    100  * (or 0 if none has been calculated) and the
    101  * standard deviation of known estimates.
    102  *
    103  */
    104 struct TWISTER_DeletePath
    105 {
    106   /**
    107    * Type: #TWISTER_MESSAGE_TYPE_DELETE_PATH
    108    */
    109   struct GNUNET_MessageHeader header;
    110 };
    111 GNUNET_NETWORK_STRUCT_END
    112 
    113 
    114 GNUNET_NETWORK_STRUCT_BEGIN
    115 
    116 /**
    117  * Network size estimate sent from the service
    118  * to clients.  Contains the current size estimate
    119  * (or 0 if none has been calculated) and the
    120  * standard deviation of known estimates.
    121  *
    122  */
    123 struct TWISTER_SetResponseCode
    124 {
    125   /**
    126    * Type: #TWISTER_MESSAGE_TYPE_SET_RESPONSE_CODE
    127    */
    128   struct GNUNET_MessageHeader header;
    129 
    130   /**
    131    * The new response code, in big endian.
    132    */
    133   uint32_t response_code GNUNET_PACKED;
    134 
    135 };
    136 GNUNET_NETWORK_STRUCT_END
    137 
    138 
    139 #endif