Ignore:
Timestamp:
Feb 2, 2008 9:12:13 AM (16 years ago)
Author:
bennylp
Message:

More ticket #465: option to return UDP header in pj_pcap_read_udp(), and better RTP packet handling in pcaputil sample

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/include/pjlib-util/pcap.h

    r1765 r1769  
    6161 
    6262/** 
     63 * This describes UDP header, which may optionally be returned in 
     64 * #pj_pcap_read_udp() function. All fields are in network byte order. 
     65 */ 
     66typedef struct pj_pcap_udp_hdr 
     67{ 
     68    pj_uint16_t src_port;   /**< Source port.       */ 
     69    pj_uint16_t dst_port;   /**< Destination port   */ 
     70    pj_uint16_t len;        /**< Length.            */ 
     71    pj_uint16_t csum;       /**< Checksum.          */ 
     72} pj_pcap_udp_hdr; 
     73 
     74 
     75/** 
    6376 * This structure describes the filter to be used when reading packets from 
    64  * a PCAP file. The filter is used to select what packets can be returned 
    65  * to a read operation. 
     77 * a PCAP file. When a filter is configured, only packets matching all the 
     78 * filter specifications will be read from PCAP file. 
    6679 */ 
    6780typedef struct pj_pcap_filter 
     
    143156 
    144157/** 
    145  * Configure filter for reading the file. 
     158 * Configure filter for reading the file. When filter is configured, 
     159 * only packets matching all the filter settings will be returned. 
    146160 * 
    147161 * @param file      PCAP file handle. 
     
    154168 
    155169/** 
    156  * Read UDP payload from the next packet in the PCAP file. 
     170 * Read UDP payload from the next packet in the PCAP file. Optionally it 
     171 * can return the UDP header, if caller supplies it. 
    157172 * 
    158173 * @param file              PCAP file handle. 
     174 * @param udp_hdr           Optional buffer to receive UDP header. 
    159175 * @param udp_payload       Buffer to receive the UDP payload. 
    160176 * @param udp_payload_size  On input, specify the size of the buffer. 
     
    165181 */ 
    166182PJ_DECL(pj_status_t) pj_pcap_read_udp(pj_pcap_file *file, 
     183                                      pj_pcap_udp_hdr *udp_hdr, 
    167184                                      pj_uint8_t *udp_payload, 
    168185                                      pj_size_t *udp_payload_size); 
Note: See TracChangeset for help on using the changeset viewer.