pcap-dlpi.c (162012) | pcap-dlpi.c (172677) |
---|---|
1/* 2 * Copyright (c) 1993, 1994, 1995, 1996, 1997 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and --- 56 unchanged lines hidden (view full) --- 65 * what we use if DL_HP_RAWDLS is defined. XXX - we use __hpux 66 * in some places to test for HP-UX, but use DL_HP_RAWDLS in 67 * other places; do we support any versions of HP-UX without 68 * DL_HP_RAWDLS? 69 */ 70 71#ifndef lint 72static const char rcsid[] _U_ = | 1/* 2 * Copyright (c) 1993, 1994, 1995, 1996, 1997 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that: (1) source code distributions 7 * retain the above copyright notice and this paragraph in its entirety, (2) 8 * distributions including binary code include the above copyright notice and --- 56 unchanged lines hidden (view full) --- 65 * what we use if DL_HP_RAWDLS is defined. XXX - we use __hpux 66 * in some places to test for HP-UX, but use DL_HP_RAWDLS in 67 * other places; do we support any versions of HP-UX without 68 * DL_HP_RAWDLS? 69 */ 70 71#ifndef lint 72static const char rcsid[] _U_ = |
73 "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.108.2.6 2005/08/13 23:15:58 guy Exp $ (LBL)"; | 73 "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.108.2.7 2006/04/04 05:33:02 guy Exp $ (LBL)"; |
74#endif 75 76#ifdef HAVE_CONFIG_H 77#include "config.h" 78#endif 79 80#include <sys/types.h> 81#include <sys/time.h> --- 309 unchanged lines hidden (view full) --- 391 return (-1); 392 } 393 ret = dlrawdatareq(p->send_fd, buf, size); 394 if (ret == -1) { 395 snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "send: %s", 396 pcap_strerror(errno)); 397 return (-1); 398 } | 74#endif 75 76#ifdef HAVE_CONFIG_H 77#include "config.h" 78#endif 79 80#include <sys/types.h> 81#include <sys/time.h> --- 309 unchanged lines hidden (view full) --- 391 return (-1); 392 } 393 ret = dlrawdatareq(p->send_fd, buf, size); 394 if (ret == -1) { 395 snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "send: %s", 396 pcap_strerror(errno)); 397 return (-1); 398 } |
399 /* 400 * putmsg() returns either 0 or -1; it doesn't indicate how 401 * many bytes were written (presumably they were all written 402 * or none of them were written). OpenBSD's pcap_inject() 403 * returns the number of bytes written, so, for API compatibility, 404 * we return the number of bytes we were told to write. 405 */ 406 ret = size; |
|
399#else /* no raw mode */ 400 /* 401 * XXX - this is a pain, because you might have to extract 402 * the address from the packet and use it in a DL_UNITDATA_REQ 403 * request. That would be dependent on the link-layer type. 404 * 405 * I also don't know what SAP you'd have to bind the descriptor 406 * to, or whether you'd need separate "receive" and "send" FDs, --- 1459 unchanged lines hidden --- | 407#else /* no raw mode */ 408 /* 409 * XXX - this is a pain, because you might have to extract 410 * the address from the packet and use it in a DL_UNITDATA_REQ 411 * request. That would be dependent on the link-layer type. 412 * 413 * I also don't know what SAP you'd have to bind the descriptor 414 * to, or whether you'd need separate "receive" and "send" FDs, --- 1459 unchanged lines hidden --- |