"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "example/daqtest.c" between
libdaq-3.0.3.tar.gz and libdaq-3.0.4.tar.gz

About: DAQ 3 is a Data Acquisition API library for packet I/O (used for e.g. by snort 3) that replaces direct calls to PCAP functions with an abstraction layer.

daqtest.c  (libdaq-3.0.3):daqtest.c  (libdaq-3.0.4)
skipping to change at line 836 skipping to change at line 836
if (napti) if (napti)
{ {
char src_addr_str[INET6_ADDRSTRLEN], dst_addr_str[INET6_ADDRSTRLEN]; char src_addr_str[INET6_ADDRSTRLEN], dst_addr_str[INET6_ADDRSTRLEN];
uint16_t src_port, dst_port; uint16_t src_port, dst_port;
inet_ntop(daq_napt_info_src_addr_family(napti), &napti->src_addr, src_ad dr_str, sizeof(src_addr_str)); inet_ntop(daq_napt_info_src_addr_family(napti), &napti->src_addr, src_ad dr_str, sizeof(src_addr_str));
src_port = ntohs(napti->src_port); src_port = ntohs(napti->src_port);
inet_ntop(daq_napt_info_dst_addr_family(napti), &napti->dst_addr, dst_ad dr_str, sizeof(dst_addr_str)); inet_ntop(daq_napt_info_dst_addr_family(napti), &napti->dst_addr, dst_ad dr_str, sizeof(dst_addr_str));
dst_port = ntohs(napti->dst_port); dst_port = ntohs(napti->dst_port);
printf("NAPT: %s : %hu -> %s : %hu\n", src_addr_str, src_port, dst_addr_ str, dst_port); printf("NAPT: Layer %hhu: %s : %hu -> %s : %hu\n", napti->ip_layer, src_ addr_str, src_port, dst_addr_str, dst_port);
} }
const DAQ_PktDecodeData_t *pdd = (const DAQ_PktDecodeData_t *) daq_msg_get_m eta(msg, DAQ_PKT_META_DECODE_DATA); const DAQ_PktDecodeData_t *pdd = (const DAQ_PktDecodeData_t *) daq_msg_get_m eta(msg, DAQ_PKT_META_DECODE_DATA);
if (pdd) if (pdd)
{ {
printf("Decode Data:\n"); printf("Decode Data:\n");
printf(" Offsets: L2 = %hu, L3 = %hu, L4 = %hu, PL = %hu, CO = %hu\n", pdd->l2_offset, printf(" Offsets: L2 = %hu, L3 = %hu, L4 = %hu, PL = %hu, CO = %hu\n", pdd->l2_offset,
pdd->l3_offset, pdd->l4_offset, pdd->payload_offset, pdd->checks um_offset); pdd->l3_offset, pdd->l4_offset, pdd->payload_offset, pdd->checks um_offset);
printf(" Flags:"); printf(" Flags:");
if (pdd->flags.bits.l2) if (pdd->flags.bits.l2)
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)