Changeset 26c2d4c
- Timestamp:
- 09/25/15 15:04:46 (6 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
- f6366a7
- Parents:
- 10553bf
- Location:
- lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_linux_common.c
rf2066fa r26c2d4c 452 452 } 453 453 454 /**455 * Converts a socket, either packet_mmap or standard raw socket into a456 * fanout socket.457 * NOTE: This means we can read from the socket with multiple queues,458 * each must be setup (identically) and then this called upon them459 *460 * @return 0 success, -1 error461 */462 inline int linuxcommon_to_packet_fanout(libtrace_t *libtrace,463 struct linux_per_stream_t *stream)464 {465 int fanout_opt = ((int)FORMAT_DATA->fanout_flags << 16) |466 (int)FORMAT_DATA->fanout_group;467 if (setsockopt(stream->fd, SOL_PACKET, PACKET_FANOUT,468 &fanout_opt, sizeof(fanout_opt)) == -1) {469 trace_set_err(libtrace, TRACE_ERR_INIT_FAILED,470 "Converting the fd to a socket fanout failed %s",471 libtrace->uridata);472 return -1;473 }474 return 0;475 }476 477 454 int linuxcommon_pause_input(libtrace_t *libtrace) 478 455 { -
lib/format_linux_common.h
r9d89626 r26c2d4c 313 313 int linuxcommon_start_input_stream(libtrace_t *libtrace, 314 314 struct linux_per_stream_t *stream); 315 inline int linuxcommon_to_packet_fanout(libtrace_t *libtrace,316 struct linux_per_stream_t *stream);317 315 int linuxcommon_pause_input(libtrace_t *libtrace); 318 316 int linuxcommon_get_fd(const libtrace_t *libtrace); … … 381 379 } 382 380 381 /** 382 * Converts a socket, either packet_mmap or standard raw socket into a 383 * fanout socket. 384 * NOTE: This means we can read from the socket with multiple queues, 385 * each must be setup (identically) and then this called upon them 386 * 387 * @return 0 success, -1 error 388 */ 389 static inline int linuxcommon_to_packet_fanout(libtrace_t *libtrace, 390 struct linux_per_stream_t *stream) 391 { 392 int fanout_opt = ((int)FORMAT_DATA->fanout_flags << 16) | 393 (int)FORMAT_DATA->fanout_group; 394 if (setsockopt(stream->fd, SOL_PACKET, PACKET_FANOUT, 395 &fanout_opt, sizeof(fanout_opt)) == -1) { 396 trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, 397 "Converting the fd to a socket fanout failed %s", 398 libtrace->uridata); 399 return -1; 400 } 401 return 0; 402 } 403 404 383 405 #endif /* FORMAT_LINUX_COMMON_H */ -
lib/protocols_pktmeta.c
rf7bcbfb r26c2d4c 175 175 { 176 176 void *nexthdr; 177 uint16_t arphrd ;178 uint16_t next ;177 uint16_t arphrd = 0; 178 uint16_t next = 0; 179 179 180 180 assert(meta != NULL);
Note: See TracChangeset
for help on using the changeset viewer.