Changeset f04e489 for lib/trace.c
- Timestamp:
- 10/28/05 16:57:37 (17 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:
- 950d54a
- Parents:
- b190686
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
ra8a9355 rf04e489 598 598 break; 599 599 case TRACE_TYPE_ETH: 600 case TRACE_TYPE_LEGACY_ETH: 600 601 { 601 602 struct libtrace_ether *eth = … … 653 654 } 654 655 break; 655 case TRACE_TYPE_ATM:656 {657 struct atm_rec *atm =658 trace_get_link(packet);659 // TODO: Find out what ATM does, and return660 // NULL for non IP data661 // Presumably it uses the normal stuff662 if (!atm) {663 ipptr = NULL;664 break;665 }666 ipptr = (void*)&atm->pload;667 break;668 }669 656 case TRACE_TYPE_LEGACY_POS: 670 657 { 671 658 // 64 byte capture. 672 legacy_framing_t *cell=659 struct libtrace_pos *pos = 673 660 trace_get_link(packet); 674 // check ethertype 675 uint16_t *etype = (uint16_t *)cell->data + 1; 676 if (*etype == 0x0008) { 677 ipptr = (void *)&cell->data[1]; 661 if (ntohs(pos->ether_type) == 0x0800) { 662 ipptr = ((void *)pos) + sizeof(*pos); 678 663 } else { 679 664 ipptr = NULL; … … 683 668 } 684 669 case TRACE_TYPE_LEGACY_ATM: 685 case TRACE_TYPE_LEGACY_ETH: 686 case TRACE_TYPE_LEGACY: 670 case TRACE_TYPE_ATM: 687 671 { 688 672 // 64 byte capture. 689 legacy_framing_t*cell =673 struct libtrace_atm_cell *cell = 690 674 trace_get_link(packet); 691 uint16_t *etype = (uint16_t *)cell->data + 3; 692 if (*etype == 0x0008) { 693 ipptr = (void *)&cell->data[2]; 675 if (ntohs(cell->ether_type) == 0x0800) { 676 ipptr = ((void *)cell) + sizeof(*cell); 694 677 } else { 695 678 ipptr = NULL;
Note: See TracChangeset
for help on using the changeset viewer.