Ralph,
Perfect. That solved my problem. I created the following patch to ifhp.c.
*** ifhp.c.old Wed Feb 25 10:56:25 2004
--- ifhp.c Mon May 10 08:32:27 2004
***************
*** 393,399 ****
}
DEBUG1("main: start snmp_dev %s, Device %s, :lp=%s",
Snmp_dev, Device, GET_HASH_STR_OBJ(Model, "lp", MEMINFO ) );
! if( ISNULL(Snmp_dev) ) Snmp_dev = Device;
if( ISNULL(Snmp_dev) ) Snmp_dev = GET_HASH_STR_OBJ(Model, "lp",
MEMINFO );
if( (s = safestrchr(Snmp_dev,'%')) ) *s = 0;
LOGMSG(LOG_INFO)"snmp device '%s'", Snmp_dev );
--- 393,401 ----
}
DEBUG1("main: start snmp_dev %s, Device %s, :lp=%s",
Snmp_dev, Device, GET_HASH_STR_OBJ(Model, "lp", MEMINFO ) );
! if( ISNULL(Snmp_dev) )
! if ( ! ISNULL(Device) )
! Snmp_dev = safestrdup(Device, MEMINFO);
if( ISNULL(Snmp_dev) ) Snmp_dev = GET_HASH_STR_OBJ(Model, "lp",
MEMINFO );
if( (s = safestrchr(Snmp_dev,'%')) ) *s = 0;
LOGMSG(LOG_INFO)"snmp device '%s'", Snmp_dev );
- Justus
[EMAIL PROTECTED]
rmatik.tu-darmsta
dt.de (Ralph To
Roessner) [EMAIL PROTECTED]
Sent by: cc
[EMAIL PROTECTED]
.com Subject
Re: LPRng: LPRng 3.8.27 w/
ifhp-3.5.17 - missing port on
05/10/2004 06:28 appsocket/SNMP printer
Please respond to
[EMAIL PROTECTED]
Hello!
I encountered the same problem, and tracked it down to the ifhp source,
I think. Of course, I could be wrong ...
See:
On Thu, May 06, 2004 at 11:53:29AM -0400,
[EMAIL PROTECTED] wrote:
>
>
[...]
> (of) main: using model 'phaser7700' at 15:32:30.570
> (of) main: appsocket device now 'wfd-color3%9100' at 15:32:30.571
> (of) Open_device: device 'wfd-color3%9100' at 15:32:30.571
Here the device appears as assigned in your "lp=" printcap entry.
[...]
> (of) main: start snmp_dev <NULL>, Device wfd-color3%9100,
:lp=wfd-color3%9100 at 15:32:30.576
> (of) snmp device 'wfd-color3' at 15:32:30.576
Here the device to use for SNMP is determined (originally it was NULL
because you have not included an "snmp_device" parameter in your "ifhp="
line.
[...]
> (of) Do_pagecount: pagecounter 41 after 1 attempts at 15:32:34.796
> (of) Start_of_job: Appsocket device close at 15:32:34.796
> (of) Open_device: device 'wfd-color3' at 15:32:34.796
And here the printer device port number has magically disappeared.
> (of) Open_device: closed fd 1 at 15:32:34.796
> (of) Link_open: missing port number 'wfd-color3' at 15:32:34.796
[...]
Now look at the source (ifhp.c line 394ff):
DEBUG1("main: start snmp_dev %s, Device %s, :lp=%s",
Snmp_dev, Device, GET_HASH_STR_OBJ(Model, "lp", MEMINFO ) );
if( ISNULL(Snmp_dev) ) Snmp_dev = Device;
if( ISNULL(Snmp_dev) ) Snmp_dev = GET_HASH_STR_OBJ(Model, "lp", MEMINFO
);
if( (s = safestrchr(Snmp_dev,'%')) ) *s = 0;
LOGMSG(LOG_INFO)"snmp device '%s'", Snmp_dev );
If we have a non-null Device but not a non-null Snmp_dev, the former is
assigned to the latter, and then the port number (if any) is removed.
At that time, Device and Snmp_dev point to the same string, so Device
loses its port number as well.
It may help to change the assignment:
Snmp_dev = Device;
to:
Snmp_dev = safestrdup(Device, MEMINFO);
I have other problems with mit HP test printer, so I cannot test the
effect right now, but you may want to give it a try.
Or as a workaroung, add "snmp_dev=wfd-color3" to your "ifhp=" config
line.
Regards,
Ralph R��ner
--
Ralph R��ner TU Darmstadt
EMail: [EMAIL PROTECTED] FB Informatik
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the
impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the
word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------