Changeset 752709f for lib/trace.c
- Timestamp:
- 03/17/06 10:58:25 (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:
- 85a0d42
- Parents:
- 548da5c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
rb51edf5 r752709f 613 613 } 614 614 free((*packet)); 615 packet = NULL;615 *packet = NULL; 616 616 } 617 617 … … 1180 1180 size_t trace_get_capture_length(const libtrace_packet_t *packet) { 1181 1181 1182 /* Packets can be have a size of zero */ 1183 assert(packet->size>=0 && packet->size<65536); 1182 assert(packet->size<65536); 1184 1183 1185 1184 if (packet->trace->format->get_capture_length) { … … 1794 1793 } 1795 1794 1795 char *trace_ether_ntoa(const uint8_t *addr, char *buf) 1796 { 1797 char *buf2 = buf; 1798 static char staticbuf[17]={0,}; 1799 if (!buf2) 1800 buf2=staticbuf; 1801 sprintf(buf2,"%02x:%02x:%02x:%02x:%02x:%02x", 1802 addr[0],addr[1],addr[2], 1803 addr[3],addr[4],addr[5]); 1804 return buf2; 1805 } 1806 1807 uint8_t *trace_ether_aton(const char *buf, uint8_t *addr) 1808 { 1809 uint8_t *buf2 = addr; 1810 unsigned int tmp[6]; 1811 static uint8_t staticaddr[6]; 1812 if (!buf2) 1813 buf2=staticaddr; 1814 sscanf(buf,"%x:%x:%x:%x:%x:%x", 1815 &tmp[0],&tmp[1],&tmp[2], 1816 &tmp[3],&tmp[4],&tmp[5]); 1817 buf2[0]=tmp[0]; buf2[1]=tmp[1]; buf2[2]=tmp[2]; 1818 buf2[3]=tmp[3]; buf2[4]=tmp[4]; buf2[5]=tmp[5]; 1819 return buf2; 1820 }
Note: See TracChangeset
for help on using the changeset viewer.