about muxsend - VxWorks

This is a discussion on about muxsend - VxWorks ; STATUS muxSend ( void * pCookie, /* protocol/device binding from muxBind() */ M_BLK_ID pNBuff /* data to be sent */ ) void * muxBind ( char * pName, /* interface name, for example, ln, ei,... */ int unit, /* unit ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: about muxsend

  1. about muxsend

    STATUS muxSend
    (
    void * pCookie, /* protocol/device binding from muxBind()
    */
    M_BLK_ID pNBuff /* data to be sent */
    )
    void * muxBind
    (
    char * pName, /* interface name, for example, ln,
    ei,... */
    int unit, /* unit number */
    BOOL (* stackRcvRtn) (void* , long, M_BLK_ID, LL_HDR_INFO * , void*
    ),
    /* receive function to be called. */
    STATUS (* stackShutdownRtn) (void* , void* ),
    /* routine to call to shutdown the stack
    */
    STATUS (* stackTxRestartRtn) (void* , void* ),
    /* routine to tell the stack it can
    transmit */
    void (* stackErrorRtn) (END_OBJ* , END_ERR* , void* ),
    /* routine to call on an error. */
    long type, /* protocol type from RFC1700 and many */
    /* other sources (for example, 0x800 is
    IP) */
    char * pProtoName, /* string name for protocol */
    void * pSpare /* per protocol spare pointer */
    )
    above is the definition of muxSend() and muxBind()

    what i need to do is get all ip packets sent to me and send them to
    another host; do the samething in the other direction.
    muxBind provide a interface to process received packet, but how
    muxsend() works? where my packets have been sent?


  2. Re: about muxsend

    When you are talking to the MUX layer, you have to form the ethernet
    header yourself, that specifies the source and destination MAC
    (ethernet) address. You can put the data in to the header of the
    packet yourself, but the mux driver has some functions to help with
    that.

    Check out muxLib - for muxSend....
    This routine transmits a packet for the service specified by pCookie.
    You got this cookie
    from a previous bind call that bound the service to a particular
    interface. This muxSend( )
    call uses this bound interface to transmit the packet.

    pCookie - Expects the cookie returned from muxBind( ). This cookie
    identifies a particular
    service-to-interface binding.
    pNBuff - Expects a pointer to the buffer that contains the packet you
    want to transmit. Before
    you call muxSend( ), you need to put the addressing information at the
    head of the
    buffer. To do this, call muxAddressForm( ). <<<< Use this if you don't
    fill in the header manually.

    Good luck,

    LC

    PS: Get ethereal hooked up to check you packet format for correctness.


+ Reply to Thread