Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Mar 95 11:23:18 MST
From:      terry@cs.weber.edu (Terry Lambert)
To:        davep@extendsys.com (David Poole)
Cc:        70312.2134@compuserve.com, questions@FreeBSD.org
Subject:   Re: HP4si with Jet Direct Network Card
Message-ID:  <9503141823.AA08032@cs.weber.edu>
In-Reply-To: <199503141410.GAA09931@freefall.cdrom.com> from "David Poole" at Mar 14, 95 07:28:18 am

next in thread | previous in thread | raw e-mail | index | archive | help
> > 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: <gah@compbio.caltech.edu>
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 <gah@compbio.caltech.edu>
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 <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

#include <string.h>

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);
}




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9503141823.AA08032>