device_t, resource, and softc

2010-03-12 Thread Cole
Hi.

Im busy implementing a kernel module to enable me to read/write
certain control registers for a PCI card. I do not wish to modify the
existing driver, merely create an add-on module that can be loaded to
accomplish what I need.

I can easily get the device_t structure of the device, and I know I
can use device_get_softc, to get the softc of the structure. I also
see there used to be a bus_get_resource function that no longer seems
to be documented or has a man page on FreeBSD. So I was wondering if
there is a way to get the resource for the device using the device_t
structure, which would allow me to easily use the rman_get_bustag, and
rman_get_bushandle functions to get the bus_tag and bus_handle values
for the device and its resouce.

Regards
/Cole
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


bus_space_tag, bus_space_handle

2010-03-11 Thread Cole
Hi.

Im currently needing to write to a few registers for a PCI device. The
driver is provided, but it does not contain support for writing
specific registers itself. I also do not with to modify the driver.

I would like to know what the best method would be for writing to
these registers, the best way to go about getting bus_space_tag, and
handle for the connected pci device.

Im currently using FreeBSD 7.x.

Regards
/Cole
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Kqueue queries

2007-06-12 Thread Cole
Hi.

I just have a few queries regarding kqueue. Ive read through the tutorial
given on the netbsd page, as well as the pdf detailing kqueue.

What I want to do is write a single threaded server for listening for
connections, and then check if they are ready to be read from for each
connection.

Ive written the code for this already, and got it handling multiple
connections, the problem comes in when the sockets close. 

This is my kevent call:
nev = kevent(kq, events, number_events, changes, number_events, NULL);

I wanted to know, what must be done when the sockets/file descriptors close.
Do I need to decrease number_events and resort the events array so that all
the active kevents are sequential without any closed sockets still in that
array?

Or, is it possible, to just keep increasing kevents and leave the closed
socket/file descriptors in the events array, and just mark them as
EV_DISABLED | EV_DELETE?

When I detect a closed socket, I have tried the following, but to no evail:
close(changes[i].ident);
EV_SET(changes[i],changes[i].ident,EVFILT_READ,EV_DISABLE | EV_DELETE
,0,0,0);
kevent(kq, changes[i], 1, NULL, 0, NULL);

If I do the above, and just keep increasing number_events and just mark the
kevent as EV_DISABLED or EV_DELETE then all it does is return that event as
soon as I call kevent() with the following values:
ident : 7, filter : -1, flags : 16384

Any suggestions/help would be appreciated, as well as pointing out if im
doing something stupid here.

Regards
/Cole


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Keyboard Boot Disable

2006-04-25 Thread Cole
Hi.

I have a large amount of servers, and the problem is, that when I need to plug 
a keyboard into them,
the keyboard is disabled since they werent booted with a keyboard.

I was wondering if anyone has some idea of how to disable the keyboard probe at 
boot and make it so
that the OS thinks that the keyboard is present even if its not plugged in, so 
that a keyboard can
be plugged in at any stage, and will function normally.

Im speaking specifically for ps2 keyboards. Is this even possible, or are there 
architecture
problems or something else relating to this that would make this impossible?

If this is possible, could someone please point me in the correct direction as 
to which code I would
need to look at to make this possible?

Regards
/Cole

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Keyboard Boot Disable

2006-04-25 Thread Cole
Hi.

I realised I forgot the version after I mailed. Im speaking about FreeBSD 4.11. 
Also by blowing the
machine up, what exactly do you mean? You end up blowing the motherboard? Or 
the keyboard? Or
specifically what?

Regards
/Cole 

-Original Message-
From: Brooks Davis [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 25, 2006 10:13 PM
To: Cole
Cc: freebsd-hackers@freebsd.org
Subject: Re: Keyboard Boot Disable

On Tue, Apr 25, 2006 at 10:10:55PM +0200, Cole wrote:
 Hi.
 
 I have a large amount of servers, and the problem is, that when I need
 to plug a keyboard into them, the keyboard is disabled since they
 werent booted with a keyboard.

 I was wondering if anyone has some idea of how to disable the keyboard
 probe at boot and make it so that the OS thinks that the keyboard is
 present even if its not plugged in, so that a keyboard can be plugged
 in at any stage, and will function normally.

 Im speaking specifically for ps2 keyboards. Is this even possible, or
 are there architecture problems or something else relating to this
 that would make this impossible?

 If this is possible, could someone please point me in the correct
 direction as to which code I would need to look at to make this
 possible?

What version of FreeBSD are you running?  This hasn't been the case by
default for ages.  As a warning, PS2 keyboards are not electricaly
designed to be hotplug so you may blow your machine up by doing this
(says someone who does it all the time).

-- Brooks

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: Keyboard Boot Disable

2006-04-25 Thread Cole
Hi.

Thanks to both you and John Baldwin for the reply. This really does help. 
Thanks for all the effort.

Regards
/Cole
 

-Original Message-
From: Brooks Davis [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 25, 2006 11:06 PM
To: Cole
Cc: 'Brooks Davis'; freebsd-hackers@freebsd.org
Subject: Re: Keyboard Boot Disable

On Tue, Apr 25, 2006 at 10:22:01PM +0200, Cole wrote:
 I realised I forgot the version after I mailed. Im speaking about
 FreeBSD 4.11. Also by blowing the machine up, what exactly do you
 mean? You end up blowing the motherboard? Or the keyboard? Or
 specifically what?

On 4.x you can remove the default flags from they atkbd entry and I
think that will do it.  See the atkbd(4) manpage for details.  Hot
plugging or unplugging they keyboard can damage the motherboard or
keyboard.

-- Brooks

 
 Regards
 /Cole 
 
 -Original Message-
 From: Brooks Davis [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, April 25, 2006 10:13 PM
 To: Cole
 Cc: freebsd-hackers@freebsd.org
 Subject: Re: Keyboard Boot Disable
 
 On Tue, Apr 25, 2006 at 10:10:55PM +0200, Cole wrote:
  Hi.
  
  I have a large amount of servers, and the problem is, that when I need
  to plug a keyboard into them, the keyboard is disabled since they
  werent booted with a keyboard.
 
  I was wondering if anyone has some idea of how to disable the keyboard
  probe at boot and make it so that the OS thinks that the keyboard is
  present even if its not plugged in, so that a keyboard can be plugged
  in at any stage, and will function normally.
 
  Im speaking specifically for ps2 keyboards. Is this even possible, or
  are there architecture problems or something else relating to this
  that would make this impossible?
 
  If this is possible, could someone please point me in the correct
  direction as to which code I would need to look at to make this
  possible?
 
 What version of FreeBSD are you running?  This hasn't been the case by
 default for ages.  As a warning, PS2 keyboards are not electricaly
 designed to be hotplug so you may blow your machine up by doing this
 (says someone who does it all the time).
 
 -- Brooks
-- 
Any statement of the form X is the one, true Y is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


tty's and no login

2006-03-07 Thread Cole
Hey

Im not sure if this is the right list, but anyway, let me know if im wrong.

What im trying to do is, have a custom program run on a specific tty. Say like 
ttyv4, or so. But I
would like to do this without having to login to this ttyv.
So instead of being presented with a login option, I would like to be able to 
switch to ttyv4, and
have it show me the output of the program that is running and using that 
terminal for output.

So exactly where about do you go about doing something like this? Is there 
something already created
to do this?

Regards
/Cole

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


RE: tty's and no login

2006-03-07 Thread Cole
Yeah.

That does help quite a lot. However, I did find something regarding this called 
own-tty, but that
was for linux, and also written in like 1998.
http://www.canonical.org/~kragen/sw/usershell.html

I was actually hoping to do something similar. In that I was hoping to just 
write a single program
to take control of the terminal and all me to use it for my input/output 
directly. Ive tried the
above program, but it does complain about TIOCSCTTY: Operation not permitted. 
Anyone have any
ideas about what exactly needs to be done to get the own-tty.c program to 
function correctly under
FreeBSD?

Thanks though for your suggestion, I'll definately make use of it if I cant 
come right.

/Cole

-Original Message-
From: Guy Helmer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 08, 2006 12:28 AM
To: [EMAIL PROTECTED]
Cc: freebsd-hackers@freebsd.org
Subject: Re: tty's and no login

Cole wrote:
 Hey

 Im not sure if this is the right list, but anyway, let me know if im wrong.

 What im trying to do is, have a custom program run on a specific tty. Say 
 like ttyv4, or so. But I
would like to do this without having to login to this ttyv.
 So instead of being presented with a login option, I would like to be able to 
 switch to ttyv4, and
have it show me the output of the program that is running and using that 
terminal for output.

 So exactly where about do you go about doing something like this? Is there 
 something already
created to do this?

   
On a physically-secured machine I have this setup for ttyv1 in /etc/ttys:

ttyv1   /usr/libexec/getty IPMonitor  cons25  on  secure

and then in /etc/gettytab I have this entry for IPMonitor:

IPMonitor:\
:al=ipmonitor:tc=Pc:

Next, I have a special user named ipmonitor that is locked out (the 
password field is set to *LOCKED* in master.passwd) but has a special 
login script, like this:

ipmonitor:*LOCKED*:65499:65499::0:0:IP Monitor 
Screen:/home/ipmonitor:/home/ipmonitor/bin/monitor.sh

Finally, the special login script for ipmonitor is this simple script:

#!/bin/sh
exec /usr/bin/systat -ip

I've also used vidcontrol with the -s option in a script like this to 
grab the screen.

Hope this helps,
Guy

-- 
Guy Helmer, Ph.D.
Principal System Architect
Palisade Systems, Inc.

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Memory Leak Free Problem

2005-09-08 Thread Cole
Hi

I have the netapp code they release for icap server. Ive ported it to FreeBSD. 
And I have found
there is a memory leak in the code itself. Ive tried contacting netapp 
directly, but no reply.

Their code can be found at : http://www.i-cap.org/spec/icap-server10.tar.gz

Ive been trying to fix the memory leak, and I think i've found the problem, but 
when I try to free
the buffer, I get this error.
icap_srv in free(): warning: page is already free

In the function : 
api_modify_respmod(const char* icap_hdr,
   const char* client_hdr,
   const char* origin_resp_hdr,
   const char* origin_resp_body,
   int origin_resp_body_len)

We have this section of code:
1.   new_body = api_filter(origin_resp_body,origin_resp_body_len);
2.   origin_resp_body_len = new_body-length;
3.   origin_resp_body = new_body-data;

I figure that the memory leak is occuring with origin_resp_body being assigned 
to the new_body
buffer. But if I try to insert a free(origin_resp_body) between line 1. and 2. 
I get the error
icap_srv in free(): warning: page is already free when running the program, 
or either the error
free(): warning: junk pointer, too high to make sense

I was wondering if there is somethign missing here. Ive checked the function 
api_filter, and it
doesnt do anything in regards to free'ing origin_resp_body, and ive also 
checked the data in the
buffer origin_resp_body before and after the function call to api_filter, and 
both values are
exactly the same.

The entire program is threaded, and I suppose it could be possible there is 
some kind of thread
problem occuring here? 

Ive also run the program through valgrind, to try and find the other memory 
leaks, but that one
seems the most obvious when going through the code.

Anyway, I would just like to know if anyone has any ideas or suggestions, or to 
point out that im a
complete moron and missing something, anything would be welcome.

Regards
/Cole

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Packet interception / Mangling

2005-06-28 Thread Cole
Hi

Isnt pcap meant to be non-intrusive, as in it only gets sent a copy of the 
packet from the kernel space to userspace? And doesnt
actually intercept anything?

Thanks for the other suggestions, but im trying to stay away from divert 
sockets, a friend also suggested libdnet, so I'll look into
that today, but if you have any further ideas, please let me know, thanks

Regards
/Cole

- Original Message -
From: Julian Elischer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: freebsd-hackers@freebsd.org
Sent: Tuesday, June 28, 2005 2:39 AM
Subject: Re: Packet interception / Mangling




 [EMAIL PROTECTED] wrote:

 Hi
 
 I wanted to know if there are any libraries similar to pcap to intercept
 packets/mangle packets.
 
 

 how about pcap?  :-)

 There are also two other mechinisms..
 divert sockets (man divert) which is used in conjuction with teh ipfw
 packet fileter
 and netgraph (man 4 netgraph, man ngctl, man ng_socket, man ng_ether)
 which can do a lot of interesting thins.

 What im trying to do specifically is like link compression, and I would then
 need to check if the packet is then compressed and decompress, and so forth 
 and
 so on.
 
 I would like to avoid having to use a ipfw divert to a port, and specifically
 check all traffic to the box using a library function or some kind of hook 
 into
 the kernel.
 
 The FreeBSD version I will be using is 4.9 or 4.11, and would like to know if
 there are any such routines available, and whether it could be a userland
 daemon, or if i am going to need to write a kernel loadable module?
 
 If anyone has any ideas or suggestions, or knows anything about this, it 
 would
 be a great help.
 
 Regards
 /Cole
 
 
 ___
 freebsd-hackers@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to [EMAIL PROTECTED]
 
 

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Packet interception / Mangling

2005-06-27 Thread cole
Hi

I wanted to know if there are any libraries similar to pcap to intercept
packets/mangle packets.

What im trying to do specifically is like link compression, and I would then
need to check if the packet is then compressed and decompress, and so forth and
so on.

I would like to avoid having to use a ipfw divert to a port, and specifically
check all traffic to the box using a library function or some kind of hook into
the kernel.

The FreeBSD version I will be using is 4.9 or 4.11, and would like to know if
there are any such routines available, and whether it could be a userland
daemon, or if i am going to need to write a kernel loadable module?

If anyone has any ideas or suggestions, or knows anything about this, it would
be a great help.

Regards
/Cole


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


FD_ZERO problem

2005-06-20 Thread Cole
Hi

Ive been looking at nbtscan, the 1.5.1 version, and it seems to core, with a 
segmentation fault.
I traced the problem down to a FD_ZERO(fdsr).

I was wondering is there any like checking that can be done before issuing that 
command. Its part of a while loop, inside the
program, where it runs fine, till the last loop, im guessing maybe its maybe 
doing an extra loop where it shouldnt, but the while
loop is
while( (select(sock+1, fdsr, fdsw, NULL, select_timeout) )  0 ) {

So I dont think the while is giving a false positive, but this isnt my code, I 
havent had time to check it all out, but I was just
wondering if there are any checks that can be done to the fd_set * fdsr pointer 
before issuing a FD_ZERO?

Regards
/Cole

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: FD_ZERO problem

2005-06-20 Thread Cole
Infact, ignore this, im not thinking today :)

Sorry for totally stupid post
/Cole

- Original Message -
From: Cole [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 20, 2005 12:36 PM
Subject: FD_ZERO problem


 Hi

 Ive been looking at nbtscan, the 1.5.1 version, and it seems to core, with a 
 segmentation fault.
 I traced the problem down to a FD_ZERO(fdsr).

 I was wondering is there any like checking that can be done before issuing 
 that command. Its part of a while loop, inside the
 program, where it runs fine, till the last loop, im guessing maybe its maybe 
 doing an extra loop where it shouldnt, but the while
 loop is
 while( (select(sock+1, fdsr, fdsw, NULL, select_timeout) )  0 ) {

 So I dont think the while is giving a false positive, but this isnt my code, 
 I havent had time to check it all out, but I was just
 wondering if there are any checks that can be done to the fd_set * fdsr 
 pointer before issuing a FD_ZERO?

 Regards
 /Cole

 ___
 freebsd-hackers@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to [EMAIL PROTECTED]

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Pci Question

2005-05-05 Thread Cole
Hi

Im trying to write a userland program that writes to the IOPORT BAR's of a pci 
card. I can find the card and all that fine. But im a
bit lost on exactly what address the IOPORT BAR's would be then? Im using the 
/dev/pci and pci(4) functions to find the card.

Ive seen in the linux version of those code, that they take the base_address's 
and then  ~0x03 them, and use that value for reading
and writing with inb_l and outb_l. Ive tried using that on FreeBSD, but with 
outl and inl, as well as writel and readl, but I keep
getting Bus error.

Is there perhaps something that I am missing or forgetting, also im running the 
program as root.

If anyone has any suggestions, they would be most welcome.

Thanks
/Cole

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Pci Question

2005-05-05 Thread Cole
Err, sorry.

I meant the linux version of this is using outl_p to communicate with the 
device, and write the values.

/Cole


- Original Message -
From: Cole [EMAIL PROTECTED]
To: freebsd-hackers@freebsd.org
Sent: Thursday, May 05, 2005 12:04 PM
Subject: Pci Question


 Hi

 Im trying to write a userland program that writes to the IOPORT BAR's of a 
 pci card. I can find the card and all that fine. But im
a
 bit lost on exactly what address the IOPORT BAR's would be then? Im using the 
 /dev/pci and pci(4) functions to find the card.

 Ive seen in the linux version of those code, that they take the 
 base_address's and then  ~0x03 them, and use that value for
reading
 and writing with inb_l and outb_l. Ive tried using that on FreeBSD, but with 
 outl and inl, as well as writel and readl, but I keep
 getting Bus error.

 Is there perhaps something that I am missing or forgetting, also im running 
 the program as root.

 If anyone has any suggestions, they would be most welcome.

 Thanks
 /Cole

 ___
 freebsd-hackers@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to [EMAIL PROTECTED]

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Pci Question

2005-05-05 Thread Cole
Nevermind,

I figured it out and got it working.

Thanks


- Original Message -
From: Cole [EMAIL PROTECTED]
To: freebsd-hackers@freebsd.org
Sent: Thursday, May 05, 2005 12:39 PM
Subject: Re: Pci Question


 Err, sorry.

 I meant the linux version of this is using outl_p to communicate with the 
 device, and write the values.

 /Cole


 - Original Message -
 From: Cole [EMAIL PROTECTED]
 To: freebsd-hackers@freebsd.org
 Sent: Thursday, May 05, 2005 12:04 PM
 Subject: Pci Question


  Hi
 
  Im trying to write a userland program that writes to the IOPORT BAR's of a 
  pci card. I can find the card and all that fine. But
im
 a
  bit lost on exactly what address the IOPORT BAR's would be then? Im using 
  the /dev/pci and pci(4) functions to find the card.
 
  Ive seen in the linux version of those code, that they take the 
  base_address's and then  ~0x03 them, and use that value for
 reading
  and writing with inb_l and outb_l. Ive tried using that on FreeBSD, but 
  with outl and inl, as well as writel and readl, but I
keep
  getting Bus error.
 
  Is there perhaps something that I am missing or forgetting, also im running 
  the program as root.
 
  If anyone has any suggestions, they would be most welcome.
 
  Thanks
  /Cole
 
  ___
  freebsd-hackers@freebsd.org mailing list
  http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
  To unsubscribe, send any mail to [EMAIL PROTECTED]

 ___
 freebsd-hackers@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to [EMAIL PROTECTED]

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


PCI Programming

2005-04-28 Thread Cole
Hey

Im currently trying to port some linux pci driver to FreeBSD code. But im 
running into a  problem. Its using a function that I cant
seem to find the equivalent of for FreeBSD.

Heres the function up to the point where im getting stuck.

int FindDevice( void )
{

static struct pci_dev *pciptr;
int pci_info_index = 0;
U16 wDev;
unsigned int tmp_addr;

/*-*/
#ifdef CONFIG_PCI  // find the specified device and its configuration
  if( pcibios_present() ){

pci_for_each_dev( pciptr ){
if ((pciptr-vendor == VENDOR_ID)  \
(pciptr-device == DEVICE_ID)  \
(pciptr-subsystem_vendor == SUBSYSTEM_VID)  \
(pciptr-subsystem_device == SUBSYSTEM_DID)  \
(PCI_FUNC(pciptr-devfn) == 0) )
{
DevExtension[pci_info_index].wBus= pciptr-bus-number;
DevExtension[pci_info_index].wDevFunc= pciptr-devfn;
DevExtension[pci_info_index].wCard = pci_info_index;
tmp_addr = pci_resource_start( pciptr, 4 );
DevExtension[pci_info_index].func0_bar = (tmp_addr  ~0x03);

now the function im getting stuck at, is the tmp_addr = 
pci_resource_start(pciptr, 4). I was wondering if anyone knows of an
equivalent under FreeBSD. Or if there is a way to obtain that value with some 
other method in FreeBSD. I am pretty much fine up
until that point.

If anyone has any sample code or anything that I could read to proceed any 
further, it would be greatly appreciated.

Regards
/Cole

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Dynamically Linked Library Problem (maybe)

2005-02-28 Thread Cole
Hey.

I have a Freebsd server running freebsd-4.9-stable.
I cvsupped the ntop src last week for 3.1.1.

I then had no problems what so ever building ntop, except for the xml plugin 
saying it was not built, cause it cannot find
xmlversion.h, even though I have libxml installed, and specified the right 
paths to the .h. But that is not the problem.
Ntop runs and works fine on this box, not a single problem that I can see.

The problem is that, I have a few other servers, that I want to copy ntop too, 
but dont want to build it on all those boxes. I
created a tar with all the ntop binaries, as well as all the libraries that its 
linked too, as well as all the plugins that ntop
uses from both the /usr/local/lib directory as well as the plugins from the 
/usr/local/lib/ntop/plugins directory. I rebuilt all the
symbolic links for all the libraries and plugins and all the files that ntop 
was linked too. I have also checked all the permissions
on all the files and they are all the same.

One other thing, the boxes that I am copying ntop to, are almost exact 
duplicates of the first box that I built ntop on, and where
it works fine.

The problem is, when running ntop on the boxes that I copied it to, after 
checking all the permissions and links and everything, I
get these errors with regards to the plugins.

Tue Mar  1 05:37:16 2005  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/icmpPlugin.so' entry function [Invalid
shared object handle 0x29a14000]
Tue Mar  1 05:37:16 2005  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/snmpPlugin.so' entry function [Invalid
shared object handle 0x29a16400]
Tue Mar  1 05:37:16 2005  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/sflowPlugin.so' entry function [Invalid
shared object handle 0x29a19800]
Tue Mar  1 05:37:16 2005  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/rrdPlugin.so' entry function [Invalid
shared object handle 0x29a1bc00]
Tue Mar  1 05:37:16 2005  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/pdaPlugin.so' entry function [Invalid
shared object handle 0x2bcae400]
Tue Mar  1 05:37:16 2005  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/netflowPlugin.so' entry function [Invalid
shared object handle 0x2d862800]
Tue Mar  1 05:37:16 2005  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/lastSeenPlugin.so' entry function
[Invalid shared object handle 0x2d866c00]
Tue Mar  1 05:37:16 2005  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/xmldumpPlugin.so' entry function [Invalid
shared object handle 0x2f697000]

I have absolutely no idea how this has happened, and I have had this problem 
before, and not a single other person was able to help
me in any regards what so ever. I was hoping maybe someone would at least know 
what this error even means, so that I have some idea
of what I am meant to be doing to fix this.

If anyone has any idea, I would gladly apprecaite any suggestions.

Thanks
/Cole



___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Ntop 3.0 and Shared Library Problem

2004-06-19 Thread Cole
Hey

Im running FreeBSD 4.9, and ive installed ntop-3.0 from Ports. Now ive had
issues with this before, so i decided to remove any and all old packages,
and all duplicate packages, and all dependencies that ntop has that were out
of date.
I then reconfigured and re-built and installed ntop from scratch.
I fixed all the config errors that appeared and all options i wanted.
And i built and installed ntop with both dynaic plugins enabled
and --enable-static-plugin option.

I have also checked that all the permissions for all the plugins and
directories and everything was correct.
But no matter what i do, i still get this problem.

Sat Jun 19 15:55:45 2004  **WARNING** Unable to locate plugin
'/usr/local/lib/ntop/plugins/netflowPlugin.so' entry function [Invalid
shared object handle 0x28070900]
Sat Jun 19 15:55:45 2004  **WARNING** Unable to locate plugin
'/usr/local/lib/ntop/plugins/nfsPlugin.so' entry function [Invalid shared
object handle 0x28070c00]
Sat Jun 19 15:55:45 2004  **WARNING** Unable to locate plugin
'/usr/local/lib/ntop/plugins/pdaPlugin.so' entry function [Invalid shared
object handle 0x28070f00]
Sat Jun 19 15:55:45 2004  **WARNING** Unable to locate plugin
'/usr/local/lib/ntop/plugins/rrdPlugin.so' entry function [Invalid shared
object handle 0x29b90200]

The odd and strange thing is, i have a few other FreeBSD 4.9 Servers, where
ntop compiles and installs the same as above, with no extra things needed to
be done, and no other configure options passed, and ntop compiles and runs
perfectly without a single one of the errors above.  Some of the other
freebsd servers where ntop works fine, is the exact same hardware as the one
above where it doesnt work.

If anyone has any ideas or any suggestions, i am willing to try anything.
Any help will be appreciated.

Thanks
/Cole

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Pthread / Memory Problem.

2004-05-26 Thread Cole
Hey

I have recently ported a linux application to FreeBSD, and i had to change a
number of libraries and so forth.
I have now managed to get it working correctly, with no build errors or
warnings.
The program runs correctly as well too, and there are no forseable problems.

The other day i noticed it was slowly taking up more memory, very slightly,
but it does.
So i did post to the list a few days ago with a topic of Memory Leak.  And
i have now used the valgrind port for FreeBSD which someone did reply to my
post with.  It does say there are 2 issues that could cause memory leaks,
and it looks like both originate from pthread_create.
Now when porting the application i did not touch any of that code, so i am
wondering, is the pthread code/library a different implementation as the
FreeBSD version, cause since there are no errors, im wondering if there is
just something that is missing in the code, or that has been done
differently on linux that may now be causing these memory leaks.

If you wish i can post the pthread_create section of code and all
surrounding code, as well as the valgrind output and where its suggesting
there are memory leaks.

Thanks
/Cole

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Memory Leak

2004-05-22 Thread Cole
Hey

I just wanted to know what programs any of you have used to track down a
memory leak in your programs?
Also wondering if there is maybe a good tutorial on the subject under
FreeBSD or even linux if possible.

Im running FreeBSD 4.9 so just looking for something try to help me track it
down.

Unless there is someone willing to help me with this since ive never really
had to do anything like this, else i can easily read something, just kinda
need to know a good memory tracing program or something of the sorts.

Thanks
/Cole

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Pthread_create and memory issues.

2004-05-22 Thread Cole
Hi

Ok this is just a more direct question that the thread Memory Leak.

I have a program using pthread_create, and it runs fine, no compile errors
or warnings, it all works fine, not a single issue, but it very very slowly
uses up memory. The program creates a fixed number of threads, and after
each one has run to completion it stores them for a while for use again if
needed soon, else it destroys them after a specified amount of time.

Now i have tried to use ElectricFence to try track down the program, and it
created cores all pointing round about to pthread_create.  So then i tried
to use mpatrol, and it either doesnt even crash, or cause errors, or it
creates a core file that is so large with so many instructions, that is well
over 1000 instruction calls, but as far as i can see they both seem to be
pointing to pthread_create.  With mpatrol i set MPATROL_OPTIONS=LEAKTABLE,
but it never produces any output and crashes before i can even test the
program. It also uses up close to 100% of the cpu before crashing.

I was just wondering if anyone else has had any other memory debugging
program suggestions, or has had any issues with pthread_create.

If you want i can post the code or at the very least my pthread_create call.

Thanks
/Cole

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


SIG_IGN

2004-05-05 Thread Cole
Hey

Im writing a threaded program to handle connections coming from squid. And
the program is working fine, except that i cant seem to set signal(SIGPIPE,
SIG_IGN)
It doesnt give any errors when performing that command, and then when i
check to see what SIGPIPE is set to, it apparently isnt SIG_IGN.

So i started to search google and i did find a page where guys had the same
problem, but that was on linux and not FreeBSD.

Im running FreeBSD 4.8-RELEASE
gcc version 2.95.4 20020320 [FreeBSD]

If anyone has any ideas please let me know.
Thanks
/Cole





___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Library problems

2004-04-11 Thread Cole
Hi

I have recently installed ntop 3.0 on freebsd 4.9 from the ports.
I then copied the binary and all needed libraries to another box also almost a 
duplicate of the box that i installed ntop 3.0 on.

When starting up ntop i get these errors, so i recompiled ntop on the new box from 
ports, and i still get these errors.
I have checked /usr/local/lib/ntop/plugins, and everything is there, and they are also 
the same as the libraries on the original box
that i installed ntop on.  Even copying the files from the plugin directory to the 
second box didnt solve this. I have recompiled,
reinstalled, tried everything, i have no idea why it is now doing this.

Sun Apr 11 16:32:18 2004  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/netflowPlugin.so' entry function [Invalid
shared object handle 0x28070a00]
Sun Apr 11 16:32:18 2004  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/nfsPlugin.so' entry function [Invalid
shared object handle 0x28070d00]
Sun Apr 11 16:32:18 2004  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/pdaPlugin.so' entry function [Invalid
shared object handle 0x29b3d000]
Sun Apr 11 16:32:18 2004  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/rrdPlugin.so' entry function [Invalid
shared object handle 0x29b3d300]
Sun Apr 11 16:32:18 2004  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/sflowPlugin.so' entry function [Invalid
shared object handle 0x29b3d600]
Sun Apr 11 16:32:18 2004  **WARNING** Unable to locate plugin 
'/usr/local/lib/ntop/plugins/xmldumpPlugin.so' entry function [Invalid
shared object handle 0x29b3d900]

If anyone can help it would be greatly appreciated.
Thanks
/Cole

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Vlan Problem/Bug maybe

2004-02-21 Thread Cole
Hey

I run freebsd 4.9-Stable. And i also use vlans and a program called freevrrp for 
redundancy. For freevrrpd to function, it needs to
change the ether MAC addresses of the interfaces it is told to use.
I found that if i assign it only to a vlan interfaces such as vlan0 or whatever, that 
it changes the ether MAC adddress of it fine.

The problem then, is that no traffic is ever picked up by that interface after that. 
After a few dumps and stuff, i realised that it
is using the new ether MAC address in the packets it sends out, which is now different 
from the parent NIC's ether MAC address. So
somewhere along when the responses are sent back, they are not being handed back to 
the Vlan device.

As soon as i changed the NIC's ether MAC address to match that of the new vlan ether 
MAC address, everything works fine again. Now
this isnt really a feasible option.

So i would like to know if there is anyone that could possibly help with some sort of 
patch to the vlan driver if_vlan.c so that
when it has its ether MAC address updated, it also updates the ether MAC address of 
the parent device.
Ive done a bit of looking and i see that somewhere in the vlan_start function inside 
if_vlan.c the ether MAC is being changed there,
but i would also like to know how to send the new ether MAC address to the parent 
device driver and have it update itself.

If there is a better list to send this too or if anyone could possibly help, it would 
be much appreciated.

Thanx
/Cole

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Mbuf Question

2003-03-31 Thread Cole
Hey

I have a quick question.

Is it possible to find out which mbuf clusters are allocated to specific programs that 
are running or is that impossible.

If it is possible, then could someone point me in the right direction for reading 
material or the functions / libraries that i would need to look at?

Thanx
Cole / Stalker
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


CFS

2003-01-01 Thread Cole Optec
Hi

I was wondering if anyone knows of a new mailing list for CFS.
I would also like to know if anyone had mod'd the CFS code to allow it to
mount directories in another mode other than 700?

Thanx Cole


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



CFS

2003-01-01 Thread cole
Hi

I would like to know if anyone knows of a new or current mailing list for CFS port.
I would also like to know if anyone has modded the code for CFS to allow the 
directories under it to be mounted in a different mode other than 700.

thanx Cole.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Winbond Hardware watchdog

2002-07-19 Thread cole

Hi, im busy writing a program to interface with a winbond IO chip on the motherboard, 
the  ports that i need to write and read from are 2e, and 2f respectively, the problem 
is that i can read from the chip fine, that works, but it appears as if i cant write 
to the chip, i have tried both the /dev/io interface as well as i386_set_ioperm f I 
would like to know if freebsd blocks direct hardware writes, or if there is something 
else that i need to do in order to allow the write through.  My kern secure level is 0 
and im running the program as root at the moment to avoid any restrictions.  If anyone 
has any ideas, please let me know

Thanx
Cole

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: bpf question

2000-05-18 Thread Travis Cole

On Wed, May 17, 2000 at 05:51:59PM +0400, Dmitry Samersoff wrote:
 I have traffic metering program using bpf,
 it works fine on relatevly free net but looses about 30% 
 of packets on havy loaded one.

Are you doing dns lookups?  Don't do those and you may fix your problem.

 
 Could any body suggest me something?
 
 Thank you!
 
 -- 
 Dmitry Samersoff, [EMAIL PROTECTED], ICQ:3161705
 http://devnull.wplus.net
 * There will come soft rains ...
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with "unsubscribe freebsd-hackers" in the body of the message

-- 
--Travis

"Linux is something for Windows haters, BSD is something for Unix lovers" 
(Heike S., Febr. 98) 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



SMP changes from 3.0 to 3.3?

1999-11-07 Thread Travis Cole


At work we have 18 or so web servers runing FreeBSD 3.0 on daul PIIs.
When they see very high loads (~300+) the SMP starts do get confused
and things randomly fail.

Were there signifigant SMP changes from 3.0-RELEASE to 3.3-RELEASE
that may make SMP more stable at high loads?  Are their any signifiant
SMP changes at all from 3.0-RELEASE to 3.3-RELEASE?

Or should I just go try and read the comit logs and see if I can
make any sense of this my self?  Last time I tried, I didn't
get to far :(

Thanks much.

-- 
--Travis

"Linux is something for Windows haters, BSD is something for Unix lovers" 
(Heike S., Febr. 98) 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Whither makefiles for src/crypto/telnet/* ?

1999-08-12 Thread Travis Cole

On Thu, Aug 12, 1999 at 11:31:27AM -0700, Nick Sayer wrote:
 
 In the scrypto section, I see that the telnet stuff is set aside
 nicely in its own spot. I was able to add my patches just fine,
 but it appears that the Makefiles are somewhere else. Maybe in
 with the kerberos stuff or something? Does anyone know how telnet
 actually gets built when you want a telnet/telnetd that uses
 encryption?

Just a me too.
I would really like to know how this is doen also.

-- 
--Travis

When it comes to violence, morality and the young, we're the Idiot Nation,
the laughingstock not only of the civilized world but of the highly-wired
generation of kids we're supposedly trying to protect.
Jon Katz


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Whither makefiles for src/crypto/telnet/* ?

1999-08-12 Thread Travis Cole
On Thu, Aug 12, 1999 at 11:31:27AM -0700, Nick Sayer wrote:
 
 In the scrypto section, I see that the telnet stuff is set aside
 nicely in its own spot. I was able to add my patches just fine,
 but it appears that the Makefiles are somewhere else. Maybe in
 with the kerberos stuff or something? Does anyone know how telnet
 actually gets built when you want a telnet/telnetd that uses
 encryption?

Just a me too.
I would really like to know how this is doen also.

-- 
--Travis

When it comes to violence, morality and the young, we're the Idiot Nation,
the laughingstock not only of the civilized world but of the highly-wired
generation of kids we're supposedly trying to protect.
Jon Katz


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: hardware

1999-07-09 Thread Travis Cole

On Fri, Jul 09, 1999 at 09:13:02PM -0400, Axis wrote:
 I have been using *BSD* for around 3 years now. My problem is thatI have
 always used the console for system administration duties. I really want to
 put a kick *** system together to run X with all of the luxuries.
 I have noticed there is not that much support for sound cards andvideo
 display adapters.
 Given your experience, Could you please inform me of which sound card and
 video display adapter works best with FreeBSD.

I have a Nvidia RivaTNT that works great in FreeBSD.  And with 
the patches from Nvidia I have hardware accelerated OpenGL working.

I say go even better and get a TNT2 for video.  Its not supported 
out of the box yet but its pretty easy to patch the XFree86 sources 
to make it work and I think XFree86 3.3.4 should have support for it.

-- 
--Travis


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: hardware

1999-07-09 Thread Travis Cole
On Fri, Jul 09, 1999 at 09:13:02PM -0400, Axis wrote:
 I have been using *BSD* for around 3 years now. My problem is thatI have
 always used the console for system administration duties. I really want to
 put a kick *** system together to run X with all of the luxuries.
 I have noticed there is not that much support for sound cards andvideo
 display adapters.
 Given your experience, Could you please inform me of which sound card and
 video display adapter works best with FreeBSD.

I have a Nvidia RivaTNT that works great in FreeBSD.  And with 
the patches from Nvidia I have hardware accelerated OpenGL working.

I say go even better and get a TNT2 for video.  Its not supported 
out of the box yet but its pretty easy to patch the XFree86 sources 
to make it work and I think XFree86 3.3.4 should have support for it.

-- 
--Travis


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message



Re: A way to crash system (3.1 3.2) with floppy

1999-06-29 Thread Travis Cole

On Mon, Jun 28, 1999 at 09:30:05PM -0400, Jamie Howard wrote:
 On Mon, 28 Jun 1999, Zhihui Zhang wrote:
 
  Suppose you have a *write-protected* DOS floppy and you do:
  
  # mount -t msdos /dev/fd0 /floppy  -- this is OK
  
  # cp somefile /floppy  -- a lot of error messages
  
  # umount /floppy   -- crash
  
  Now the system tries to sync the dirty buffers and fails.  You have to
  press a key to reboot. 
  
  Is there anything wrong here or FreeBSD simply does not handle this in a
  more elegant way? 
  
  Thanks for any help.
 
 I had this happen to me the other day on my 3.2 system.  I thought it was
 just me because I had mounted the disk several days before and figured I
 had swapped it out.  I also had to reformat the floppy on a Win95 system
 to make it usable again.
 
 Jamie

I just reproduced this on a system running 4.0-CURRENT from about
Sun Jun 27 01:12:42 PDT

I got a ton of these errors in dmesg and /var/log/messages:
Jun 29 00:17:53 marx /kernel: fd0c: hard error writing fsbn 19 (ST0 40abnrml ST1 
2write_protect ST2 0 cyl 0 hd 1 sec 2)

And it let me try several umount commands and even a umount -f.  None
of them actualy umounted the floppy drive and it completly reboot my computer
after about 2 or 3 mins.  No panic or anything.  Once second I'm looking at X, 
next second I'm looking at my BIOS bootup screen.

-- 
--Travis


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: A way to crash system (3.1 3.2) with floppy

1999-06-29 Thread Travis Cole
On Mon, Jun 28, 1999 at 09:30:05PM -0400, Jamie Howard wrote:
 On Mon, 28 Jun 1999, Zhihui Zhang wrote:
 
  Suppose you have a *write-protected* DOS floppy and you do:
  
  # mount -t msdos /dev/fd0 /floppy  -- this is OK
  
  # cp somefile /floppy  -- a lot of error messages
  
  # umount /floppy   -- crash
  
  Now the system tries to sync the dirty buffers and fails.  You have to
  press a key to reboot. 
  
  Is there anything wrong here or FreeBSD simply does not handle this in a
  more elegant way? 
  
  Thanks for any help.
 
 I had this happen to me the other day on my 3.2 system.  I thought it was
 just me because I had mounted the disk several days before and figured I
 had swapped it out.  I also had to reformat the floppy on a Win95 system
 to make it usable again.
 
 Jamie

I just reproduced this on a system running 4.0-CURRENT from about
Sun Jun 27 01:12:42 PDT

I got a ton of these errors in dmesg and /var/log/messages:
Jun 29 00:17:53 marx /kernel: fd0c: hard error writing fsbn 19 (ST0 40abnrml 
ST1 2write_protect ST2 0 cyl 0 hd 1 sec 2)

And it let me try several umount commands and even a umount -f.  None
of them actualy umounted the floppy drive and it completly reboot my computer
after about 2 or 3 mins.  No panic or anything.  Once second I'm looking at X, 
next second I'm looking at my BIOS bootup screen.

-- 
--Travis


To Unsubscribe: send mail to majord...@freebsd.org
with unsubscribe freebsd-hackers in the body of the message