pcap-dlpi.c (17683) | pcap-dlpi.c (26175) |
---|---|
1/* 2 * Copyright (c) 1993, 1994, 1995, 1996 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 --- 7 unchanged lines hidden (view full) --- 16 * written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 * 21 * This code contributed by Atanu Ghosh (atanu@cs.ucl.ac.uk), 22 * University College London. 23 */ | 1/* 2 * Copyright (c) 1993, 1994, 1995, 1996 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 --- 7 unchanged lines hidden (view full) --- 16 * written permission. 17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 20 * 21 * This code contributed by Atanu Ghosh (atanu@cs.ucl.ac.uk), 22 * University College London. 23 */ |
24#ifndef lint 25static char rcsid[] = 26 "@(#)$Header: pcap-dlpi.c,v 1.42 96/07/23 14:20:32 leres Exp $ (LBL)"; 27#endif | |
28 29/* 30 * Packet capture routine for dlpi under SunOS 5 31 * 32 * Notes: 33 * 34 * - Apparently the DLIOCRAW ioctl() is specific to SunOS. 35 * 36 * - There is a bug in bufmod(7) such that setting the snapshot 37 * length results in data being left of the front of the packet. 38 * 39 * - It might be desirable to use pfmod(7) to filter packets in the 40 * kernel. 41 */ 42 | 24 25/* 26 * Packet capture routine for dlpi under SunOS 5 27 * 28 * Notes: 29 * 30 * - Apparently the DLIOCRAW ioctl() is specific to SunOS. 31 * 32 * - There is a bug in bufmod(7) such that setting the snapshot 33 * length results in data being left of the front of the packet. 34 * 35 * - It might be desirable to use pfmod(7) to filter packets in the 36 * kernel. 37 */ 38 |
39#ifndef lint 40static const char rcsid[] = 41 "@(#) $Header: pcap-dlpi.c,v 1.47 96/12/10 23:15:00 leres Exp $ (LBL)"; 42#endif 43 |
|
43#include <sys/types.h> 44#include <sys/time.h> 45#ifdef HAVE_SYS_BUFMOD_H 46#include <sys/bufmod.h> 47#endif 48#include <sys/dlpi.h> 49#ifdef HAVE_SYS_DLPI_EXT_H 50#include <sys/dlpi_ext.h> --- 485 unchanged lines hidden (view full) --- 536 case DL_ERROR_ACK: 537 switch (dlp->error_ack.dl_errno) { 538 539 case DL_BADPPA: 540 sprintf(ebuf, "recv_ack: %s bad ppa (device unit)", 541 what); 542 break; 543 | 44#include <sys/types.h> 45#include <sys/time.h> 46#ifdef HAVE_SYS_BUFMOD_H 47#include <sys/bufmod.h> 48#endif 49#include <sys/dlpi.h> 50#ifdef HAVE_SYS_DLPI_EXT_H 51#include <sys/dlpi_ext.h> --- 485 unchanged lines hidden (view full) --- 537 case DL_ERROR_ACK: 538 switch (dlp->error_ack.dl_errno) { 539 540 case DL_BADPPA: 541 sprintf(ebuf, "recv_ack: %s bad ppa (device unit)", 542 what); 543 break; 544 |
545 |
|
544 case DL_SYSERR: 545 sprintf(ebuf, "recv_ack: %s: %s", 546 what, pcap_strerror(dlp->error_ack.dl_unix_errno)); 547 break; 548 | 546 case DL_SYSERR: 547 sprintf(ebuf, "recv_ack: %s: %s", 548 what, pcap_strerror(dlp->error_ack.dl_unix_errno)); 549 break; 550 |
551 case DL_UNSUPPORTED: 552 sprintf(ebuf, 553 "recv_ack: %s: Service not supplied by provider", 554 what); 555 break; 556 |
|
549 default: 550 sprintf(ebuf, "recv_ack: %s error 0x%x", 551 what, (bpf_u_int32)dlp->error_ack.dl_errno); 552 break; 553 } 554 return (-1); 555 556 default: --- 31 unchanged lines hidden (view full) --- 588 req.dl_primitive = DL_BIND_REQ; 589#ifdef DL_HP_RAWDLS 590 req.dl_max_conind = 1; /* XXX magic number */ 591 /* 22 is INSAP as per the HP-UX DLPI Programmer's Guide */ 592 req.dl_sap = 22; 593 req.dl_service_mode = DL_HP_RAWDLS; 594#else 595 req.dl_sap = sap; | 557 default: 558 sprintf(ebuf, "recv_ack: %s error 0x%x", 559 what, (bpf_u_int32)dlp->error_ack.dl_errno); 560 break; 561 } 562 return (-1); 563 564 default: --- 31 unchanged lines hidden (view full) --- 596 req.dl_primitive = DL_BIND_REQ; 597#ifdef DL_HP_RAWDLS 598 req.dl_max_conind = 1; /* XXX magic number */ 599 /* 22 is INSAP as per the HP-UX DLPI Programmer's Guide */ 600 req.dl_sap = 22; 601 req.dl_service_mode = DL_HP_RAWDLS; 602#else 603 req.dl_sap = sap; |
604#ifdef DL_CLDLS 605 req.dl_service_mode = DL_CLDLS; |
|
596#endif | 606#endif |
607#endif |
|
597 598 return (send_request(fd, (char *)&req, sizeof(req), "bind", ebuf)); 599} 600 601static int 602dlbindack(int fd, char *bufp, char *ebuf) 603{ 604 --- 224 unchanged lines hidden --- | 608 609 return (send_request(fd, (char *)&req, sizeof(req), "bind", ebuf)); 610} 611 612static int 613dlbindack(int fd, char *bufp, char *ebuf) 614{ 615 --- 224 unchanged lines hidden --- |