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
dlbindack(9F)						   Kernel Functions for Drivers 					     dlbindack(9F)

NAME
dlbindack, dlphysaddrack, dlokack, dlerrorack, dluderrorind - DLPI device driver helper functions SYNOPSIS
#include <sys/dlpi.h> void dlokack(queue_t *wq, mblk_t *mp, t_uscalar_t correct_primitive); void dlerrorack(queue_t *wq, mblk_t *mp, t_uscalar_t error_primitive, t_uscalar_t error, t_uscalar_t unix_errno); void dlbindack(queue_t *wq, mblk_t *mp, t_scalar_t sap, const void *addrp, t_uscalar_t addrlen, t_uscalar_t maxconind, t_uscalar_t xidtest); void dlphysaddrack(queue_t *wq, mblk_t *mp, const void *addrp, t_uscalar_t addrlen); void dluderrorind(queue_t *wq, mblk_t *mp, const void *addrp, t_uscalar_t addrlen, t_uscalar_t error, t_uscalar_t unix_errno); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
wq Streams write queue. mp Pointer to the bind request message. sap Service access point being requested. addrp Pointer to the dlpi layer source address. addrlen Size of the dlpi layer address pointed to by addr. maxconind Maximum number of DL_CONNECT_IND messages allowed to be outstanding per stream. xidtest The XID and TEST responses supported. correct_primitive Identifies the DL primitive completing successfully. error_primitive Identifies the DL primitive in error. error DLPI error associated with the failure in the DLPI request. unix_errno Corresponding UNIX system error that can be associated with the failure in the DLPI request. DESCRIPTION
All functions described in this manpage take a pointer to the message passed to the DLPI provider (mblk_t) and attempt to reuse it in for- mulating the M_PROTO reply. If the message block is too small to be reused, it is freed and a new one is allocated. All functions reply upstream using qreply(9F). The write-side queue pointer must be provided. The dlokack() function provides the successfull acknowledgement DL_OK_ACK message reply to the DLPI provider and is used to complete many of the DLPI requests in the DLPI consumer. The dlerrorack() function provides the unsuccessfull acknowledgement DL_ERROR_ACK message reply to the DLPI provider and is used for error completions were required for DLPI requests in the DLPI consumer. The dlbindack() function provides the DL_BIND_ACK message reply to the DLPI provider and is used to complete the DL_BIND_REQ processing in the DLPI consumer. The dlphysaddrack() function provides the DL_PHYS_ADDR_ACK message reply used to complete the DL_PHYS_ADDR_ACK processing. The dluderrorind() function provides the DL_UDERROR_IND message reply used to complete an unsuccessfull DL_UNITDATA_REQ. RETURN VALUES
None. NOTES
These functions are not required if you are are writing a DLPI device driver using gld(7D). CONTEXT
All DLPI helper functions can be called from user or interrupt context. SEE ALSO
gld(7D), dlpi(7P), qreply(9F) Writing Device Drivers STREAMS Programming Guide SunOS 5.10 1 Aug 2004 dlbindack(9F)
All times are GMT -4. The time now is 10:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy