include/trace-tools/wifi/frame/dissector/default_hooks.hh

00001 /*
00002  * trace-tools - A library and a set of tools to manipulate wireless traces.
00003  * Copyright (C) 2007  Universite Pierre et Marie Curie - Paris 6
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00018  * MA  02110-1301  USA
00019  *
00020  * Author: Thomas Claveirole <thomas.claveirole@lip6.fr>
00021  */
00022 #ifndef WIFI_FRAME_DISSECTOR_DEFAULT_HOOKS_HH_
00023 # define WIFI_FRAME_DISSECTOR_DEFAULT_HOOKS_HH_
00024 
00025 # include <trace-tools/wifi/frame/mgt.hh>
00026 # include <trace-tools/wifi/frame/ctl.hh>
00027 # include <trace-tools/wifi/frame/data.hh>
00028 # include <trace-tools/wifi/frame/dissector/status.hh>
00029 
00030 namespace wifi
00031 {
00032 
00033   namespace frame
00034   {
00057     struct dissector_default_hooks
00058     {
00060       typedef dissector_status::status  status;
00061 
00062     protected:
00063 
00064       //        ******************* //
00066       //        ******************* //
00068 
00069       void      invalid_type_or_subtype_hook(const void*, size_t, status);
00070       void      invalid_type_hook(const void*, size_t);
00071       void      invalid_subtype_hook(const void*, size_t, status);
00072       void      invalid_management_subtype_hook(const mgt::header*, size_t);
00073       void      invalid_control_subtype_hook(const void*, size_t);
00074       void      invalid_data_subtype_hook(const void*, size_t, status);
00075 
00077 
00078 
00079       //        *********** //
00081       //        *********** //
00083 
00084 
00086       void      frame_hook(const void*, size_t);
00087 
00094       void      addr_hook(const void*, size_t, unsigned, const addr&);
00095 
00102       void      seq_ctl_hook(const void*, size_t, unsigned, unsigned);
00103 
00105       void      end_of_frame_hook(const void*, size_t, status);
00106 
00108       void      management_hook(const mgt::header*, size_t);
00109 
00111       void      control_hook(const void*, size_t);
00112 
00114       void      data_hook(const void*, size_t);
00115 
00117 
00118 
00119       //        *************** //
00121       //        *************** //
00123 
00124       void      truncated_frame_hook(const void*, size_t, status);
00125       void      truncated_unknown_frame_hook(const void*, size_t);
00126       void      truncated_management_frame_hook(const mgt::header*, size_t,
00127                                                 status);
00128       void      truncated_ps_poll_frame_hook(const ctl::ps_poll::header*,
00129                                              size_t, status);
00130       void      truncated_rts_frame_hook(const ctl::rts::header*, size_t,
00131                                          status);
00132       void      truncated_cf_end_frame_hook(const ctl::cf_end::header*, size_t,
00133                                             status);
00134       void      truncated_cf_end_cf_ack_frame_hook(const ctl::cf_end_cf_ack::
00135                                                    header*, size_t, status);
00136       void      truncated_cts_frame_hook(const ctl::cts::header*, size_t);
00137       void      truncated_ack_frame_hook(const ctl::ack::header*, size_t);
00138       void      truncated_data_frame_hook(const void*, size_t, status);
00139 
00140       // @}
00141 
00142       //        ********************** //
00144       //        ********************** //
00146 
00147       // Field hooks.
00148       void      management_addr1_hook(const mgt::header*, size_t);
00149       void      management_addr2_hook(const mgt::header*, size_t);
00150       void      management_addr3_hook(const mgt::header*, size_t);
00151       void      management_seq_ctl_hook(const mgt::header*, size_t,
00152                                         unsigned, unsigned);
00153 
00154       // Inidividual frame subtypes.
00155       void      beacon_hook(const mgt::header*, size_t);
00156       void      assoc_req_hook(const mgt::header*, size_t);
00157       void      assoc_resp_hook(const mgt::header*, size_t);
00158       void      reassoc_req_hook(const mgt::header*, size_t);
00159       void      reassoc_resp_hook(const mgt::header*, size_t);
00160       void      probe_req_hook(const mgt::header*, size_t);
00161       void      probe_resp_hook(const mgt::header*, size_t);
00162       void      atim_hook(const mgt::header*, size_t);
00163       void      disassoc_hook(const mgt::header*, size_t);
00164       void      auth_hook(const mgt::header*, size_t);
00165       void      deauth_hook(const mgt::header*, size_t);
00166 
00168 
00169 
00170       //        ******************* //
00172       //        ******************* //
00174 
00175       // Individual frame subtypes.
00176       void      ps_poll_hook(const ctl::ps_poll::header*, size_t);
00177       void      rts_hook(const ctl::rts::header*, size_t);
00178       void      cf_end_hook(const ctl::cf_end::header*, size_t);
00179       void      cf_end_cf_ack_hook(const ctl::cf_end_cf_ack::header*, size_t);
00180       void      cts_hook(const ctl::cts::header*, size_t);
00181       void      ack_hook(const ctl::ack::header*, size_t);
00182 
00183       // Field hooks //
00184 
00185       // PS Poll.
00186       void      ps_poll_addr1_hook(const ctl::ps_poll::header*, size_t);
00187       void      ps_poll_addr2_hook(const ctl::ps_poll::header*, size_t);
00188 
00189       // RTS.
00190       void      rts_addr1_hook(const ctl::rts::header*, size_t);
00191       void      rts_addr2_hook(const ctl::rts::header*, size_t);
00192 
00193       // CF-End.
00194       void      cf_end_addr1_hook(const ctl::cf_end::header*, size_t);
00195       void      cf_end_addr2_hook(const ctl::cf_end::header*, size_t);
00196 
00197       // CF-End + CF-Ack.
00198       void cf_end_cf_ack_addr1_hook(const ctl::cf_end_cf_ack::header*, size_t);
00199       void cf_end_cf_ack_addr2_hook(const ctl::cf_end_cf_ack::header*, size_t);
00200 
00201       // CTS.
00202       void      cts_addr1_hook(const ctl::cts::header*, size_t);
00203 
00204       // Ack.
00205       void      ack_addr1_hook(const ctl::ack::header*, size_t);
00206 
00208 
00209       //        **************** //
00211       //        **************** //
00213 
00214       // Field hooks.
00215       void      data_addr1_hook(const void*, size_t);
00216       void      data_addr2_hook(const void*, size_t);
00217       void      data_addr3_hook(const void*, size_t);
00218       void      data_addr4_hook(const void*, size_t);
00219       void      data_seq_ctl_hook(const void*, size_t, unsigned, unsigned);
00220 
00221       // Individual frame subtypes.
00222       void      data_only_hook(const void*, size_t, status);
00223       void      data_cf_ack_hook(const void*, size_t, status);
00224       void      data_cf_poll_hook(const void*, size_t, status);
00225       void      data_cf_ack_cf_poll_hook(const void*, size_t, status);
00226       void      null_hook(const void*, size_t, status);
00227       void      cf_ack_hook(const void*, size_t, status);
00228       void      cf_poll_hook(const void*, size_t, status);
00229       void      cf_ack_cf_poll_hook(const void*, size_t, status);
00230 
00231       void      within_ibss_hook(const data::within_ibss::header*, size_t);
00232       void      from_ds_hook(const data::from_ds::header*, size_t);
00233       void      to_ds_hook(const data::to_ds::header*, size_t);
00234       void      ap_to_ap_hook(const data::ap_to_ap::header*, size_t);
00235 
00237 
00238     };
00239 
00240   } // End of namespace wifi::frame.
00241 
00242 } // End of namespace wifi.
00243 
00244 # include "default_hooks.hxx"
00245 
00246 #endif // ! WIFI_FRAME_DISSECTOR_DEFAULT_HOOKS_HH_

Generated on Wed Sep 12 16:02:47 2007 for trace-tools by  doxygen 1.5.3