Changeset 5395ce6 for lib


Ignore:
Timestamp:
10/14/05 15:07:06 (16 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
31709e8d
Parents:
641dc7c
Message:
  • Fix prototypes for trace_get_<mumble>_from_ip
  • Fix documentation for the event framework
Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace.h

    reaa5529 r5395ce6  
    353353 * @author Perry Lorier
    354354 */
    355 struct libtrace_tcp *trace_get_tcp_from_ip(struct libtrace_ip *ip,int *skipped);
     355struct libtrace_tcp *trace_get_tcp_from_ip(const struct libtrace_ip *ip,int *skipped);
    356356
    357357/** get a pointer to the UDP header (if any)
     
    370370 * Skipped may be NULL, in which case it will be ignored by this function.
    371371 */
    372 struct libtrace_udp *trace_get_udp_from_ip(struct libtrace_ip *ip,int *skipped);
     372struct libtrace_udp *trace_get_udp_from_ip(const struct libtrace_ip *ip,int *skipped);
    373373
    374374/** get a pointer to the ICMP header (if any)
     
    387387 * Skipped may be NULL, in which case it will be ignored by this function
    388388 */
    389 struct libtrace_icmp *trace_get_icmp_from_ip(struct libtrace_ip *ip,int *skipped);
     389struct libtrace_icmp *trace_get_icmp_from_ip(const struct libtrace_ip *ip,int *skipped);
    390390
    391391/** parse an ip or tcp option
     
    465465
    466466/** Link layer types
     467 * This enumates the various different link types that libtrace understands
    467468 */
    468469typedef enum {
    469        TRACE_TYPE_LEGACY,
     470       TRACE_TYPE_LEGACY,      
    470471       TRACE_TYPE_HDLC_POS,
    471        TRACE_TYPE_ETH,
     472       TRACE_TYPE_ETH,                  /**< 802.3 style Ethernet */
    472473       TRACE_TYPE_ATM,
    473        TRACE_TYPE_80211,
     474       TRACE_TYPE_80211,                /**< 802.11 frames */
    474475       TRACE_TYPE_NONE,
    475        TRACE_TYPE_LINUX_SLL,
    476        TRACE_TYPE_PFLOG,
     476       TRACE_TYPE_LINUX_SLL,            /**< Linux "null" framing */
     477       TRACE_TYPE_PFLOG,                /**< FreeBSD's PFlug */
    477478       TRACE_TYPE_LEGACY_DEFAULT,
    478479       TRACE_TYPE_LEGACY_POS,
     
    533534int8_t trace_get_direction(const struct libtrace_packet_t *packet);
    534535
    535 /** Event types */
     536/** Event types
     537 * see \ref libtrace_eventobj_t
     538 */
    536539typedef enum {
    537         TRACE_EVENT_IOWAIT,
    538         TRACE_EVENT_SLEEP,
    539         TRACE_EVENT_PACKET,
    540         TRACE_EVENT_TERMINATE
     540        TRACE_EVENT_IOWAIT,     /**< Need to block on fd */
     541        TRACE_EVENT_SLEEP,      /**< Sleep for some time */
     542        TRACE_EVENT_PACKET,     /**< packet has arrived */
     543        TRACE_EVENT_TERMINATE   /**< End of trace */
    541544} libtrace_event_t;
    542545
    543546/** structure returned by libtrace_event explaining what the current event is */
    544547struct libtrace_eventobj_t {
    545         libtrace_event_t type; /**< event type (iowait,sleep,packet */
     548        libtrace_event_t type; /**< event type (iowait,sleep,packet) */
    546549        int fd;                /**< if IOWAIT, the fd to sleep on */
    547550        double seconds;        /**< if SLEEP, the amount of time to sleep for */
  • lib/trace.c

    reaa5529 r5395ce6  
    710710 * Skipped can be NULL, in which case it will be ignored by the program.
    711711 */
    712 struct libtrace_tcp *get_tcp_from_ip(const struct libtrace_ip *ip, int *skipped)
     712struct libtrace_tcp *trace_get_tcp_from_ip(const struct libtrace_ip *ip, int *skipped)
    713713{
    714714#define SW_IP_OFFMASK 0xff1f
     
    752752 * Skipped can be NULL, in which case it will be ignored by the program.
    753753 */
    754 struct libtrace_udp *get_udp_from_ip(const struct libtrace_ip *ip, int *skipped)
     754struct libtrace_udp *trace_get_udp_from_ip(const struct libtrace_ip *ip, int *skipped)
    755755{
    756756        struct libtrace_udp *udpptr = 0;
     
    793793 * Skipped can be NULL, in which case it will be ignored by the program.
    794794 */
    795 struct libtrace_icmp *get_icmp_from_ip(struct libtrace_ip *ip, int *skipped)
     795struct libtrace_icmp *trace_get_icmp_from_ip(const struct libtrace_ip *ip, int *skipped)
    796796{
    797797        struct libtrace_icmp *icmpptr = 0;
Note: See TracChangeset for help on using the changeset viewer.