Пример #1
0
/**
 *\brief Add new extension NTP header into Flow.
 *\param [in] packet.
 *\param [out] rec Destination Flow.
 */
void NTPPlugin::add_ext_ntp(Flow &rec, const Packet &pkt)
{
   RecordExtNTP *ntp_data_ext = new RecordExtNTP();
   if (!parse_ntp(pkt, ntp_data_ext)) {
      delete ntp_data_ext; /*Don't add new extension packet.*/
   } else {
      rec.addExtension(ntp_data_ext); /*Add extension to  packet.*/
   }
}
Пример #2
0
int SIPPlugin::post_create(Flow &rec, const Packet &pkt)
{
   uint16_t msg_type;

   msg_type = parse_msg_type(pkt);
   if (msg_type == SIP_MSG_TYPE_INVALID) {
      return 0;
   }

   RecordExtSIP *sip_data = new RecordExtSIP();
   sip_data->msg_type = msg_type;
   rec.addExtension(sip_data);
   parser_process_sip(pkt, sip_data);

   return 0;
}