From owner-freebsd-questions Tue Mar 14 13:33:43 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id NAA04258 for questions-outgoing; Tue, 14 Mar 1995 13:33:43 -0800 Received: from cs.weber.edu (cs.weber.edu [137.190.16.16]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id NAA04240 for ; Tue, 14 Mar 1995 13:33:36 -0800 Received: by cs.weber.edu (4.1/SMI-4.1.1) id AA08032; Tue, 14 Mar 95 11:23:19 MST From: terry@cs.weber.edu (Terry Lambert) Message-Id: <9503141823.AA08032@cs.weber.edu> Subject: Re: HP4si with Jet Direct Network Card To: davep@extendsys.com (David Poole) Date: Tue, 14 Mar 95 11:23:18 MST Cc: 70312.2134@compuserve.com, questions@FreeBSD.org In-Reply-To: <199503141410.GAA09931@freefall.cdrom.com> from "David Poole" at Mar 14, 95 07:28:18 am X-Mailer: ELM [version 2.4dev PL52] Sender: questions-owner@FreeBSD.org Precedence: bulk > > Anyone out there printing with FreeBSD to an HP4si laser printer with > > Jet Direct Network > > Card? We have several Windows and SCO Unix machines which can print to it. > > The > > UNIX ones use TCP/IP and something called 'hpnpf'. What can I use with > > FreeBSD. > > Thanks for your help --- > > You should be able to use ftp/lp with the JetDirect card. If not, hpnpf > is an HP utility that sends data directly to a TCP port, usually 9100. > Should be simple to create, but I think hpnpf has source floating around > somewhere. This should be part of the base/extended print system. Barring that, here is a recent copy for the mailing list archives. Terry Lambert terry@cs.weber.edu --- Any opinions in this posting are my own and not those of my present or previous employers. ============================================================================= >From gah@compbio.caltech.edu Wed Jul 27 15:22:22 1994 Return-Path: Received: from bioserv.compbio.caltech.edu (bioserv.hood.caltech.edu) by cs.weber.edu (4.1/SMI-4.1.1) id AA00576; Wed, 27 Jul 94 15:21:26 MDT Received: by bioserv.compbio.caltech.edu (5.0/DEI:4.45) id AA29912; Wed, 27 Jul 1994 14:26:30 +0800 From: Glen Herrmannsfeldt Date: Wed, 27 Jul 1994 14:26:30 +0800 Message-Id: <9407272126.AA29912@bioserv.compbio.caltech.edu> To: terry@cs.weber.edu Subject: Re: HP JetDirect Cards for Ethernet Content-Length: 1347 Status: OR iWell, it came originally from a sample whois program in the Comer "internetworking with TCP/IP," though, as far as I know, that isn't a problem, at least if you don't want to sell it. If you are really worried, or want a good book (highly recommended by everyone) then buy one. Hope it works for you. -- glen #include #include #include #include #include #include main(argc,argv) int argc; char **argv; { int i,s,len; struct sockaddr_in sa; struct hostent *hp; struct servent *sp; unsigned char buf[BUFSIZ]; char *myname,*host,*user; myname=argv[0]; switch(argc) { case 1: host="default.host.goes.here"; break; case 2: host=argv[1]; break; default: fprintf(stderr,"Usage: %s [host]\n",myname); exit(1); } if((hp=gethostbyname(host))==NULL) { fprintf(stderr,"%s: %s: no such host?\n",myname,host); exit(1); } #if 0 bcopy((char*)hp->h_addr,(char*)&sa.sin_addr,hp->h_length); #else memcpy((char*)&sa.sin_addr,(char*)hp->h_addr,hp->h_length); #endif sa.sin_family=hp->h_addrtype; sa.sin_port=9100; if((s=socket(hp->h_addrtype,SOCK_STREAM,0))<0) { perror("socket"); exit(1); } if(connect(s,&sa,sizeof sa)<0) { perror("connect"); exit(1); } while((len=read(0,buf,BUFSIZ))>0) write(s,buf,len); close(s); exit(0); }