Sponsored Content
Full Discussion: AIX STREAMS driver question
Operating Systems AIX AIX STREAMS driver question Post 302504990 by rocktilldie on Tuesday 15th of March 2011 11:32:03 PM
Old 03-16-2011
AIX STREAMS driver question

Hi all,

I have a AIX kernel STREAMS question need your help,
I need to implement a firewall on AIX and get packet raw data then decide pass or drop it,
I've seen similiar firewall code on HP-UX,
on HP-UX, you have to implement a "dlpi STREAMS driver", and specify it as a "dlpi" driver in metadata,
then you can get the packet in your STREAMS driver's read and write callback function just like below sample driver.

I found following sample code in IBM site,

Code:
#include <errno.h>
#include <sys/stream.h>
static int passclose(), passopen
(), passrput(), passwput();
static struct module_info minfo = { 0, "pass", 0, INFPSZ, 2048, 128 };
static struct qinit rinit = { passrput, 0, passopen, passclose, 0, &minfo };
static struct qinit winit = { passwput, 0, 0, 0, 0, &minfo };
struct streamtab passinfo = { &rinit, &winit };
static int
passclose (queue_t *q)
{
return 0;
}
static int
passopen (queue_t *q, dev_t *devp, int flag, int sflag, cred_t *credp)
{
return 0;
}
static int
passrput (queue_t *q, mblk_t *mp)
{
putnext(q, mp);
return 0;
}
static int
passwput (queue_t *q, mblk_t *mp)
{
putnext(q, mp);
return 0;
}

But I have two question
(1) I don't know how to register this sample driver as a dlpi driver on AIX,
Do I have to specify something in struct module_info? But seems there's no module_info declaration on website, where can I get it?
or do I need specify something when call strload?

(2) Writing a dlpi STREAS driver to hook network packet on AIX is a feasible way as a firewall?

Thanks a lot for your information.

Ryan

Last edited by pludi; 03-16-2011 at 05:00 AM.. Reason: code tags, please
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

NIC driver building question

I'm way confused. I loaded RH 7.1 on an old P-75 Compaq. IT has an EtherExpress pro/100 card in it and I have that attached to the optional port on our firewall with a crossover....I can't seem to get the card to negotiate with the firewall...it's currently 100Meg at Half duplex. I'm at a loss... (3 Replies)
Discussion started by: kwalter
3 Replies

2. Solaris

SUNWglmr -- rasctrl environment monitoring driver for i2c or SCSI device driver ?

I've been researching minimizeing Solaris 8 and found that on the web page http://www.sun.com/bigadmin/content/packagelist/s8u7PkgList/p2.html the package SUNWglmr is listed as "rasctrl environment monitoring driver for i2c, (Root) (32-bit)" while in the document "Solaris 8 minimize-updt1.pdf"... (1 Reply)
Discussion started by: roygoodwin
1 Replies

3. OS X (Apple)

open-source driver question

Hi, I'm a linux guy and have used netbsd, openbsd, freebsd etc in the past but never tangled with the kernel or drivers outside of Linux. My mother has fried her ethernet port on her iMac (G4 I think); I recently sent her a silicom USB U2E (usb 2 ethernet) dongle which is evidently not... (2 Replies)
Discussion started by: sjalex
2 Replies

4. AIX

Need EMC Symmetrix driver for AIX 5.3

Hi all, I hope I'm putting my first post at this site into the right forum. I need help finding the EMC disk driver for AIX version 5.3. I have some new EMC disk presented to a backup server of mine, and right now the EMC hdisks show up looking like this in an lsdev: hdisk495 Available... (2 Replies)
Discussion started by: C.J.Hund
2 Replies

5. AIX

Uninstall native MPIO driver on AIX

Hi, I was trying to uninstall the native MPIO driver on the AIX 6.1 machine we have in our lab and ran into a whole bunch dependent filesets initially. I deleted the disks, fcsX, fscsiX, fcnetX and tried again, but ran into the same error. Subsequently, I figured out that the OS disks in... (4 Replies)
Discussion started by: ronykris
4 Replies

6. AIX

how to know if my aix have multi-path driver installed?

I have an aix server, it is not a VIO server or client. I need to check if it has multi-path driver installed, how to check it? (1 Reply)
Discussion started by: rainbow_bean
1 Replies

7. UNIX for Dummies Questions & Answers

boot option Available partitions 0b00 1048575 sr0 driver:sr 0800 488386584 sda driver:sd

Help, suspect hacked via serial or electric! any ideas on error "Pid:1, comm:swapper Tainted:G W 2.6.35-22 generic #33 -unbutu device = "(null)" or unknown-blocklist(8.1) please append a correct "root"boot option Available partitions 0b00 1048575 sr0 driver:sr 0800 488386584 sda driver:sd. Thanks... (3 Replies)
Discussion started by: kryclear
3 Replies

8. Hardware

Difference between platform driver,codec driver and Machine driver

In general terms what are the differences platform driver,codec driver and Machine driver? (1 Reply)
Discussion started by: rupeshkp728
1 Replies

9. BSD

A question about BSD kernel and driver

I have an old hppa workstation install Openbsd on it,suppose i want to use bktr driver on it,i see bktr is configured on some archs(amd64,i386,ppc) but not on hppa,can i use the bktr driver line from amd64 or i386 in Generic kernel or custom kernel config? (3 Replies)
Discussion started by: Linusolaradm1
3 Replies
pseudo(1)						      General Commands Manual							 pseudo(1)

NAME
pseudo - Starts a non-STREAMS pty interface for a STREAMS device SYNOPSIS
pseudo [-l] [-shell shell] OPTIONS
Starts a shell process as the login shell. By default, the command starts this process as an interactive shell. Specifies the shell to be started. By default, the command starts the shell set by the SHELL environment variable. DESCRIPTION
The pseudo command provides an appropriate interface for STREAMS tty devices that are installed on systems configured to use the non- STREAMS pty driver. The pseudo command opens a pair of master and slave pty devices, and starts a shell process. The command's options allow you to override the default shell specification and to specify that the process be started as a login shell. NOTES
The pseudo command is available only when one or more of the Tru64 UNIX optional subsets with worldwide support software are installed on your system. In order for the pseudo command to provide a non-STREAMS pty interface for STREAMS devices, the system must be configured to use the non- STREAMS pty driver. If the system is configured to use the STREAMS pty driver, the command provides a STREAMS pty interface. SEE ALSO
Commands: stty(1) Interfaces: pty(7) pseudo(1)
All times are GMT -4. The time now is 04:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy