Changeset 9075d49 for lib/trace.c
- Timestamp:
- 03/23/05 22:34:39 (16 years ago)
- 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:
- 23c13e8
- Parents:
- 783825a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
rc4be35b r9075d49 1530 1530 pcap = pcap_open_dead(DLT_EN10MB, 1500); 1531 1531 break; 1532 case TRACE_TYPE_LINUX_SLL: 1533 pcap = pcap_open_dead(DLT_LINUX_SLL, 1500); 1534 break; 1532 1535 default: 1533 printf("only works for ETH a t the moment\n");1536 printf("only works for ETH and LINUX_SLL (ppp) at the moment\n"); 1534 1537 assert(0); 1535 1538 } … … 1583 1586 * @param packet a pointer to a libtrace_packet structure 1584 1587 * @returns a signed value containing the direction flag, or -1 if this is not supported 1588 * The direction is defined as 0 for packets originating locally (ie, outbound) 1589 * and 1 for packets originating remotely (ie, inbound). 1590 * Other values are possible, which might be overloaded to mean special things 1591 * for a special trace. 1585 1592 * @author Daniel Lawson 1586 1593 */ … … 1600 1607 break; 1601 1608 case PCAP: 1609 case PCAPINT: 1602 1610 switch (trace_get_link_type(packet)) { 1603 1611 case TRACE_TYPE_LINUX_SLL: … … 1606 1614 sll = trace_get_link(packet); 1607 1615 /* 0 == LINUX_SLL_HOST */ 1608 if (sll->pkttype==0) { 1609 direction = 0; 1616 /* the Waikato Capture point defines "packets 1617 * originating locally" (ie, outbound), with a 1618 * direction of 0, and "packets destined locally" 1619 * (ie, inbound), with a direction of 1. 1620 * This is kind-of-opposite to LINUX_SLL. 1621 * We return consistent values here, however 1622 * 1623 * Note that in recent versions of pcap, you can 1624 * use "inbound" and "outbound" on ppp in linux 1625 */ 1626 if (ntohs(sll->pkttype==0)) { 1627 1628 direction = 1; 1610 1629 } 1611 1630 else { 1612 direction = 1;1631 direction = 0; 1613 1632 } 1614 1633 break;
Note: See TracChangeset
for help on using the changeset viewer.