STREAM module question

Hi all,
I am newbe in STREAM module development and this question might be a concept error. If so, please could you give me some clues?
I would like to use the "libc" funcion "getpwuid()" in a kernel STREAM module.
I have Solaris 7 64-bit kernel.
�Can I do it? I have read that for 64-bit kernels, only dynamic libraries are available. Therefore in order ot use libc functions I would have to link dynamically the module relocatable object with the libc library in sparcv9. I have tried to link the kernel STREAM module with libc.so.1 (in /usr/lib/sparcv9) with no success so far. Everytime I trie to load the module it complains with the message: unknown symbol "getpwuid".
If it is not possible, why? . Is it not possible to use libc functions such us: memcpy() etc..from the kernel context?
Looking forward to hearing from you.
Best Regards

You cannot use user space libraries from within a kernel module. What exactly are you trying to
do? What do you need password information for
down in the kernel?
Maybe ddi_get_cred() will help?
Some functions like memcopy have kernel space equivalents (bcopy)....
dan

Similar Messages

  • Stream module

    Hi,
    Is there any command can insert a stream module into a stream module stacks, or I have to use ioctl() with
    my own program to do so? I read about autopush. It
    seems it cannot do that.
    And anyone know the how the IP,TCP and etc. to
    be pushed on a stream network driver when the
    system is started up?
    -- David

    Hi.
    How do you know what the original values were?
    They can be changed via streamhead, other module,
    or even via ioctl if the driver has support for changing
    flow control via ioctl. Regardless, are they changed
    from when the device is plumbed, or changed from a previous
    patch? Very high/low values indicate the flow control
    is effectively turned off. However, you may be running
    into a different problem having to do with STREAMS
    perimeters. What is the value of q_syncqmsgs for the queue(s)
    in question?
    max

  • Creating arp entry within stream module

    HI all.
    I'm tying to create an arp entry from within a stream modules stacked between eri and ip. My module is loaded on two interface (eri0 and eri1) and is use as a mangler for packet flowing through it. It take a packet on one interface do some processing on it if neccessary and put it on the other. My two interface are set in promiscious mode using dlpi promisc on message. This way the server become transparent to the network if placed in the critical path. My problem is the server must have only one ip address configured.
    Ex:
    Here there my two stream.
    (1)
    arp
    ip -- 192.168.0.10
    me
    eri0
    (2)
    arp
    ip -- 1.1.1.1
    me
    eri1
    I got some host on the network on both side of my server which is in the critical path between the two segment of the same network. ( hope i'm clear). host on segment can talk to other on the other side perfectly. host on the side of the interface with the valid ip address can communicate with service running on the server but the one on the side with the dummy ip can't. This is because there is no arp entry in the table for this ip with the valid interface (eri0). If i add one myself it work fine. I must mention that there is an entry in the arp table for the host ip with the invalid interface and that i respond myself to the arp request comming from the side of the invalid interface. When a connection is tried to the eri1side i see arp request from my server on the read queue of my module comming from eri0 because of promiscious mode data feedback. I send this request on the other queue and when i get the reply I tried to sending M_PROTO DL_UNITDATA_IND on the queue of the valide interface. Whitout success as you could see.
    I read on other post. That's was because of the fastpath routing. I actually see ioctl message comming downstream when i load my module ont both interface. I tried founding info about these but couldn't. Could i just respond to this ioctl with IOCNACK with the same data to disable? Is this a request to enable fast routing? (the first two byte are 0x4050 if i remember)
    If you know what i'm trying to do is impossible please tell me.
    Thank's.
    Seb.

    It is possible. I effectivly have to disable fast path for it to work. to disable you have to intercept M_IOCTL msg and qreply with M_IOCNAK - EINVAL if it's a DL_IOC_HDR_INFO ioc_cmd. This ioctl isn't the 0x4050???? one but is 0x0000440a.

  • How to reconfigure the tcp/ip stack in Solar8 to include my STREAMS module?

    I am currently writing a NAT STREAMS module that I would like to place on the tcp/ip stack so it intercepts all incoming and outgoing packets going to or coming from the IP module. I want the stack to look like the following:
    Current Solaris Stack: hme0 -> ip -> tcp
    The new stack I want: hme0 -> MY_NAT -> ip -> tcp
    I would appreciate any help to my problem. Also, if anyone knows a resource where I could find any more information like this please let me know. I've look at docs.sun.com and searched the web but I still haven't found the answer.
    Thanks,
    Ben

    Check out the Solaris 8 (or 9) STREAMS programming manual on docs.sun.com.
    It covers in detail how from userspace or from kernelspace linking a STREAMS module into the chain of modules. I think the example it gives is with terminal drivers, but same idea.

  • How to install STREAMS-modules

    Hi,
    I am a Newbie in writing STREAMS-modules.I have copied the compiled and linked module to /usr/kernel/strmod, but I am not able to push it because calling ioctl/I_PUSH results in an EINVAL error (running strchg also fails). A try to push standard modules like "ldterm" or "u8lat1" succeeded.
    After renaming and deleting such a standard module I can still push it by it's old name (but not by the new one).
    Perhaps I made a mistake in the procedure of coding, compiling and linking the module, but I can not explain the fact the deleted modules still exist, so I going to believe in metaphysics.
    Please help me!
    Hendrik Suess

    Hi there,
    As far as I got your situation, your problem is related to the
    fact that you are running the 64-bit kernel (since your modload
    searches for modules in /usr/kernel/strmod/sparcv9 directory).
    AFAIK, gcc does not build 64-bit modules by default - you have
    to force it to do so (if it is at all able to build them).
    So the simplest way to check your module is to reboot your station
    in 32-bit mode (<pre>boot unix/kernel</pre> from the boot prompt).
    However, if you intend to use your module on 64-bit systems, you
    should build 64-bit module. The Answerbook contains special chapter
    about 64-bit modules/drivers and I've found lots of usefull hints
    there.
    General tip - GCC is great tool, but if you are developing kernel
    modules/drivers - try to use native (Sun) compiler. Ok, it costs
    several bucks, but after all it is used by Sun people that develop
    the kernel, so it is [almost always] up-to-date and hence will save you lots of time and pain.
    Hope, this helps,
    Ilya.

  • Compiling STREAM module for 64-bit kernel

    Hi,
    I am trying to compile a STREAM module for Solaris. The results I get when I execute "isalist" and "isainfo -kv" are:
    -"sparcv9+vis sparcv9 sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc"
    -"64-bit sparcv9 kernel modules"
    The host is a Ultra5_10 with SunOS 5.7 sun4u sparc.
    First I tried to compile the module with gcc 2.8.1 but altough the compilation apparentelly finisihed OK I did not get to load the module. Later I read that, gcc so far does not generate binaries for 64-bit sparc.
    So I installed the Sun WorkShop 5 environment (try version) and I tried to compile my sources with the following line:"cc -D_KERNEL -xarch=v9 -xcode=abs32 -xregs=no%appl -x03 -I. -I/usr/include -c mymodule.c"
    but I get a huge list of errors such as:
    "/usr/include/sys/thread.h/, line73:warning: volatile is a keyworkd in
    ANSI C"
    "/usr/include/sys/thread.h/, line 73:sintax error before or at:volatile"
    so if I compile adding the directire "-D_ASM" to the previous line, the list of errors descreases to 2 lines:
    "/usr/include/sys/kstat.h, line 52: sintax error before or at: hrtime_t"
    "/usr/include/sys/kstat.h, line 52: cannot recover from previous errors".
    I have also tried adding directives such as: -D_LP64 -D__sparcv9 -D_POSIX_C_SOURCE, -D_XOPEN_SOURCE but I do not get to compile it successfully.
    Could someone be so kind to give me a clue of what I am doing wrong, and what should I do in order to compile it??.
    The header files I have included right now in my ".c" are:
    #include <sys/stream.h>
    #include <sys/conf.h>
    #include <sys/modctl.h>
    #include <sys/kmem.h>
    #include <sys/cmn_err.h>
    #include <sys/ddi.h>
    #include <sys/sunddi.h>
    If I do not add the directives -I. -I/usr/include to the compile line above I get the following error:
    "/usr/include/sys/modctl.h, line 185: major, argument mismatch"
    "/usr/include/sys/cred.h, line 51: sintax error before or at: uint_t"
    But this is because the environment it is taken the /usr/ucbinclude as default include path instead of the "/usr/include". �which one should I consider?.
    Thank in advance for your support.
    Looking forward to hearing from you.
    (could you please send to me the answeres to this e-mail:[email protected]??)
    Regards
    Elena

    HI,
    Maybe a file I can edit that says to run the Garmin stuff in 32-bit mode?
    Right or control click the Garmin application (or utility) then click: Get Info
    In the Get Info window under the General tab, if it can be enabled you should see:
    Open in 32-bit mode.
    Activity Monitor (Applications/Utilities) shows all apps running in 64 bit. If it doesn't have 64 bit under Kind on the right, then it's running in 32 bit mode.
    Carolyn

  • How can a streams module read files?

    I have a streams module which runs over IP. When it gets loaded
    for the first time, a data file has to be read and data structures
    have to be initialised accordignly.
    But I'm not able to use open, read calls from inside the module (naturally!).
    Any pointers?
    Here is the sample code:
    int _init(void)
    /* open (), read () calls have be inserted here */
    return (mod_install(&sample_modlinkage));
    }

    See 'File I/O from within a driver' thread in this forum for a discussion...

  • Live Streaming Basic Question

    I am using the AWS version of the flash media server and attempting to stream content however, I am getting stuck. Following the instructions at http://help.adobe.com/en_US/flashmediaserver/amazonec2/WS6fc2df2b6d2ce24359910e2812c396a83 eb-7ff8.2.html, it says "4. Go to the Flash Media Playback Setup page at http://www.osmf.org/configurator/fmp/ and do the following:"  That link is broken. Can you advise where the updated link is?
    Thanks,
    Matt

    The answer was to go back to Wowza.  Adobe dropped the ball.
    RT
    ashish gupta. <mailto:[email protected]>
    December 15, 2014 at 3:44 AM
    >
          Live Streaming Basic Question
    created by ashish gupta.
    <https://forums.adobe.com/people/ashish+gupta.> in /Adobe Media
    Server/ - View the full discussion
    <https://forums.adobe.com/message/7015154#7015154>

  • Help needed, example (serial port) streams module not working.

    I am trying to make work the tblt.c example of a streams module on Solaris 8.
    This sample is the one provided by Sun in it's Driver Dev. Kit.
    My test program gets blocked in the I_PUSH ioctl (after having successfully
    poped ttcompat and ldterm).
    Debug prints in the module tell me that the tbltopen() stays in the loop
         * Now wait for it. Let our read queue put routine wake us up
         * when it arrives.
         while (tbltd->tbltd_flags & TBLT_IOCWAIT) {
              if (!qwait_sig(q)) {
                   lwp_error = EINTR;
                   goto error;
    done, after
    iocb = (struct iocblk *)mp->b_wptr;
         iocb->ioc_count = sizeof (struct iocblk);
         cb = (struct termios *)datap->b_wptr;
         cb->c_iflag = 0;
         cb->c_oflag = 0;
         cb->c_cflag = CREAD|CS8|B9600;
         cb->c_lflag = 0;
         bzero((caddr_t)cb->c_cc, NCCS);
         datap->b_wptr += sizeof (*cb)/(sizeof (*datap->b_wptr));
         mp->b_cont = datap;
         tbltd->tbltd_flags |= TBLT_IOCWAIT;     /* indicate that we're */
         tbltd->tbltd_iocid = iocb->ioc_id;     /* waiting for this response */
         (void) putnext(WR(q), mp);
    (used to set baudrate, I suppose)
    and only a Ctlr-C of my test prog. makes it return via
    lwp_error = EINTR;
                   goto error;
    A few years ago, I had no trouble with the same Solaris 5 example.
    and my hardware (tablet + cable) works fine on a Solaris 5 system.

    darren,
    thanks for your help here and over on comp.sys.solaris. ultimately the problem was portmon on ttya, and i think i know how it happened. the machine was set up with a keyboard and monitor, and ttya was enabled using admintool. later, with the machine headless, the console was changed over to ttya via eeprom, which produced the conflict i noted above.
    solution:
    # pmadm -l
    PMTAG PMTYPE SVCTAG FLGS ID <PMSPECIFIC>
    zsmon ttymon ttyb u root /dev/term/b I - /usr/
    bin/login - 9600 ldterm,ttcompat ttyb login: - tvi925 y #
    zsmon ttymon ttya u root /dev/term/a - - /usr/
    bin/login - 9600 ldterm,ttcompat neo ttya login: - vt100 y #Terminal
    # pmadm -d -p zsmon -s ttya
    # pmadm -l
    PMTAG PMTYPE SVCTAG FLGS ID <PMSPECIFIC>
    zsmon ttymon ttyb u root /dev/term/b I - /usr/
    bin/login - 9600 ldterm,ttcompat ttyb login: - tvi925 y #
    zsmon ttymon ttya ux root /dev/term/a - - /usr/
    bin/login - 9600 ldterm,ttcompat neo ttya login: - vt100 y #Terminal
    # echo $TERM
    sun-color
    # svccfg
    svc:> select system/console-login
    svc:/system/console-login> setprop ttymon/terminal_type = "vt100"
    svc:/system/console-login> exit
    # echo $TERM
    vt100
    also see
    http://www.bordergatewayprotocol.net/jon/helpful_stuff/solaris/solaris-advanced-sysadmin-guide/ch09/181-186.html

  • How to inform the kernel about newly installed STREAMS MODULE?

    I made a copy of timod and installed the copy to /kernel/strmod
    as a new module (newmod). I modified the t_open.c to make
    it to use the "newmod" instead of the timod. The result of the
    test is "Invalid Argument". It looks like the kernel doesn't
    recognize the module "newmod". I looked throught Sun
    Docs, I'm not able to find any instruction for how to
    make kernel to recognize my new STREAMS module name
    as the add_drv does for device drivers. Can anyone point
    me to the right docs and give me some instructions for informing
    the kernel about the newly installed STREAMS module?
    Thanks
    Yuen

    Forget my precedent post, here is what's on the configuration page of this module :
    ("[_]" are checkboxe)
    1/ [_] Check this option if your users' DNs look like cn=jdoe,ou=Group1,cn=example,cn=com and Group1 turns out to be the group you want.)
    Attribute of the DN which contains the group name:
    [Single line text field to enter attribute]
    (The name of the attribute which contains the group name. In the example above, it would be ou, as the DN contains the string ou=Group1 and Group1 happens to be the desired group name.
    2/ [_] Groups are specified by LDAP attributes
    Attribute names (one per line):
    [Multi-lines text field]
    (If the groups are stored in the user entries, along with the rest of their data, then enter here a list of attributes which may contain them.)
    3/ [_] Groups exist as LDAP entries where a multivalued attribute contains the members' CNs
    Nodes containing groups (one per line):
    [Multi-lines text field]
    (Enter here a list of nodes from where groups should be searched for. The module will look them up recursively from the given nodes.)
    Attribute holding group members:
    [Single line text field]
    (Name of the multivalued attribute which holds the CNs of group members, for example: memberUid)
    If someone could tell me which checkboxe I should select and what to put into fields it would be king as I really have no idea of what to enter and what to select.

  • Is it safe/acceptable to  build on the pfil STREAM module?

    Does anyone know if it is safe to build on top of the pfil module by calling its public interfaces? I need to build a STREAM module to intercept TCP packets and was in the process of essentially duplicate all of the code in the pfil module, when I realized it would be much simpler to call pfil_add_hook directly. However, the pfil.h header is not provided with the package (not sure if there is a developer package I need) so I don't want to just assume these are truely public interfaces open to modules beyond the ipfilter module.

    Some Internet services use UDP, which means that you have to allow incoming packets. Conceivably there might be an unknown remote exploit in Firefox that would make it unsafe to allow that traffic. No one can absolutely guarantee that there isn't. But if it's a well-known site and a well-known protocol, you're almost certainly OK.

  • Flash live streaming encoder question

    Does flash8 pro encode STREAMING video as VP6 or Sorenson?
    Non live streaming is VP6, but there seems to be no
    conclusive answer as to whether live streaming uses the same
    encoder.
    I guess not, otherwise something like on2 flix live would
    have no reason to exist if you already own flash pro...

    The answer was to go back to Wowza.  Adobe dropped the ball.
    RT
    ashish gupta. <mailto:[email protected]>
    December 15, 2014 at 3:44 AM
    >
          Live Streaming Basic Question
    created by ashish gupta.
    <https://forums.adobe.com/people/ashish+gupta.> in /Adobe Media
    Server/ - View the full discussion
    <https://forums.adobe.com/message/7015154#7015154>

  • Timers in STREAMS module

    Hi,
    I want to develop a STREAMS module. For that I want to write a timer library. I have developed a timer library using signal & alarm system calls, which runs in user space. Can I use the same timer library in kernel space for the STREAMS module?
    If it is not possible to use this libary, Can anyone give me pointers for how to go for it?
    regards,
    dattatray.

    Hi,
    You can use qtimeout(9F) and quntimeout(9f) functions to implement time intervals in your modules. Please see man pages for these functions for more details. Also, please see Streams Programming Guide for SOlaris.
    Hope this helps,
    --Sun/DTS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • What steps are required to install and load a new STREAMS module?

    I have a new STREAM module based on sample code from the STREAMS Programming Guide. Everything compiles correctly but modload is failing. I get the error "can't load module: No such file or directory" everytime. I've tried fully qualifing the path, coping my module to the /kernel and /kernel/strmod directories, with and without the -p option. Nothing is working.
    The only thing I can think of is that additional steps must be necessary to make the module available to the system. Can anyone give me some pointers here?
    I am running Solaris 10 on an amd64 system.

    I've tried copying it to /kernel, /kernel/strmod, /kernel/strmod/amd64 and the corresponding /usr directories with no luck.
    I found a reference in one of the forums about unresolved externals causing the same issue, but I can not find any log entries to indicate why modload is failing.
    Is add_drv required for a STREAMS module? From the doucmentation it looks like this is only required for device drivers. My module is a straight STREAM (modlstrmod) module.

  • Order the FAQ module questions

    I am trying to order the FAQ module questions in Business Catalyst.
    It puts them in alphabetical order by default so I numbered them. But once it gets to 10 it obviously goes out of order.
    And the client does not want to put a letter in front. ie A, B, C
    Any ideas on how to acheive this?
    Thanks in advance.

    Try leaving numerical gaps in your weighting scheme so you have future flexibility.
    For example, I like to use the weightings of 1000, 900, 800, 700 and so on.
    Then I have a LOT of wiggle room to add new information and sort my information the way I like.
    Tricia

Maybe you are looking for

  • Pictures not displaying in iMessages.

    Why do some iPads not display pictures attached to iMessages? 2 iPads using the same Apple ID will sometimes not both show the incoming attached picture.

  • Digital Audio and Software 6.0

    So I updated to 6.0 the other night and now my digital audio is not working. I have video going through HDMI to TV and Toslink going to Receiver. The audio goes through HDMI to TV no problem. The Toslink is not transmitting audio. I made sure that Do

  • Length () error !!!

    Hi when i clicked an exit button inside ActionListener the program will automatically quits... Ok , i add a JTextArea in main function did so... String textenter = textarea.getText();  //textarea object of JTextArea int len = textenter.length(); i ca

  • I want "rotate me" for n95 8gb pleaseeeeee

    can anyone here help me get a rotate me for my n95 8gb.i have downloaded many from net but they are unsigned and when i try to install it doesnt.in net in some sites they have shown ways to sign but its very confusing.can anyone help me out by gettin

  • How do I revert my homescreen back?

    I was playing around with my iPod, and checking out how the restrictions settings worked a bit, and managed to hit the don't allow use of the apps. My iPod touch's apps that I had arranged all disappeared. I wondered if it just hid them, but as soon