top logo menu kitty mascot
AROS.ORG Developers Localization Bounties

envoy_nipc

Index


AbortNIPCEvent() AbortTransaction() AddRoute() AllocateIPProtocolA()
AllocateUDPPortA() AllocNIPCBuff() AllocNIPCBuffEntry() AllocNIPCBuffEntryWithMem()
AllocNIPCEvent() AllocNIPCEventPort() AllocTransactionA() AppendNIPCBuff()
BeginTransaction() CalcNIPCChecksum() CancelNIPCEvent() CheckNIPCEvent()
CheckTransaction() CopyFromNIPCBuff() CopyNIPCBuff() CopyToNIPCBuff()
CreateEntityA() DeleteEntity() DeleteRoute() DoTransaction()
FindEntity() FreeIPProtocol() FreeNIPCBuff() FreeNIPCBuffEntry()
FreeNIPCEvent() FreeNIPCEventPort() FreeTransaction() FreeUDPPort()
GetEntityAttrsA() GetEntityName() GetHostName() GetNIPCEvent()
GetNIPCEventCode() GetNIPCEventData() GetNIPCEventTime() GetTransaction()
LockNIPCBuff() LoseEntity() NIPCBuffLength() NIPCBuffPointer()
NIPCControlA() NIPCInquiryA() PingEntity() RegisterIPProtocol()
RegisterUDPPort() ReplyTransaction() ScheduleNIPCEvent() SendICMPMessageA()
SendIPPacketA() SendUDPPacketA() SetDeviceIPAddressA() SetEntityAttrsA()
WaitEntity() WaitTransaction()    

AbortNIPCEvent()

Synopsis

void AbortNIPCEvent(
         struct NIPCEvent * event );

Function

Deliver a pending event now instead of at its time.

AbortTransaction()

Synopsis

void AbortTransaction(
         struct Transaction * transaction );

Function

Abort a transaction started with BeginTransaction() if it is still
a request: it returns to the source entity with ENVOYERR_ABORTED.
Follow with WaitTransaction(). Nothing is sent on the wire.

AddRoute()

Synopsis

BOOL AddRoute(
         ULONG network,
         ULONG gateway,
         UWORD hops,
         WORD ttl );

Function

Route creation through this interface is not supported on AROS.
The call leaves the routing table unchanged.

Inputs

network - Ignored.
gateway - Ignored.
hops - Ignored.
ttl - Ignored.

Result

Always FALSE.

Notes

Configure routes through the TCP/IP stack.

AllocateIPProtocolA()

Synopsis

APTR AllocateIPProtocolA(
         UWORD protonr,
         APTR input,
         APTR cleanup,
         struct TagItem * tags );

APTR AllocateIPProtocol(
         UWORD protonr,
         APTR input,
         APTR cleanup,
         TAG tag, ... );

Function

Private IP protocol allocation is not supported on AROS.
No handler is created and no callback is installed.

Inputs

protonr - Ignored.
input - Ignored; may be NULL.
cleanup - Ignored; may be NULL.
tags - Ignored; may be NULL.

Result

Always NULL.

Notes

Callback pointers are neither invoked nor retained. The tag
list is not read. No storage is allocated.

AllocateUDPPortA()

Synopsis

APTR AllocateUDPPortA(
         LONG localport,
         APTR datain,
         struct TagItem * tags );

APTR AllocateUDPPort(
         LONG localport,
         APTR datain,
         TAG tag, ... );

Function

Private UDP port allocation is not supported on AROS.
No port is reserved and no receive callback is installed.

Inputs

localport - Ignored.
datain - Ignored; may be NULL.
tags - Ignored; may be NULL.

Result

Always NULL.

Notes

The callback is neither invoked nor retained. The tag list
is not read. No storage is allocated.

AllocNIPCBuff()

Synopsis

struct NIPCBuff * AllocNIPCBuff(
         ULONG entries );

Function

Allocate a buffer with the given number of (empty) entries.

AllocNIPCBuffEntry()

Synopsis

struct NIPCBuffEntry * AllocNIPCBuffEntry();

Function

Allocate an empty buffer entry; the caller supplies nbe_Data.

AllocNIPCBuffEntryWithMem()

Synopsis

struct NIPCBuffEntry * AllocNIPCBuffEntryWithMem(
         ULONG size );

Function

Allocate an entry together with size bytes of data memory, freed
with the entry.

AllocNIPCEvent()

Synopsis

struct NIPCEvent * AllocNIPCEvent(
         ULONG eventcode,
         APTR eventdata,
         struct MsgPort * eventport );

Function

Allocate an event that will be delivered to eventport.

AllocNIPCEventPort()

Synopsis

struct MsgPort * AllocNIPCEventPort();

Function

A message port for events (CreateMsgPort()).

AllocTransactionA()

Synopsis

struct Transaction * AllocTransactionA(
         struct TagItem * tags );

struct Transaction * AllocTransaction(
         TAG tag, ... );

Function

Allocate a transaction. TRN_AllocReqBuffer / TRN_AllocRespBuffer
(sizes) also allocate the buffers; TRN_ReqDataNIPCBuff /
TRN_RespDataNIPCBuff declare that the caller's buffers are
struct NIPCBuff.

AppendNIPCBuff()

Synopsis

void AppendNIPCBuff(
         struct NIPCBuff * first,
         struct NIPCBuff * second );

Function

Move the entries of second to the end of first; second is left
empty (and still to be freed).

BeginTransaction()

Synopsis

BOOL BeginTransaction(
         struct Entity * dest_entity,
         struct Entity * src_entity,
         struct Transaction * transaction );

Function

Start a transaction from src_entity to dest_entity. The structure
belongs to the library until it returns to the source entity as
TYPE_RESPONSE. A local destination receives the structure itself;
a remote one receives the request data over the link, and the
response is written back into the response buffer.

Unlike the original, this implementation never blocks the caller
while the link's transmit window is full: fragments are queued and
sent as the window opens.

CalcNIPCChecksum()

Synopsis

UWORD CalcNIPCChecksum(
         APTR data,
         ULONG length,
         UWORD startsum );

Function

16-bit one's complement sum of a byte range, continuing from
startsum (not complemented).

CancelNIPCEvent()

Synopsis

void CancelNIPCEvent(
         struct NIPCEvent * event );

Function

Take a pending event out of the queue without delivering it.

CheckNIPCEvent()

Synopsis

ULONG CheckNIPCEvent(
         struct NIPCEvent * event );

Function

1 while the event is pending, 0 otherwise.

CheckTransaction()

Synopsis

BOOL CheckTransaction(
         struct Transaction * transaction );

Function

TRUE if the transaction is complete, failed, or was never sent.

CopyFromNIPCBuff()

Synopsis

ULONG CopyFromNIPCBuff(
         struct NIPCBuff * src_buff,
         UBYTE * dest_data,
         ULONG srcoffset,
         ULONG length );

Function

Copy bytes out of a buffer into memory.

Result

Bytes copied.

CopyNIPCBuff()

Synopsis

ULONG CopyNIPCBuff(
         struct NIPCBuff * src_buff,
         struct NIPCBuff * dest_buff,
         ULONG srcoffset,
         ULONG dstoffset,
         ULONG length );

Function

Copy between buffers.

Result

Bytes copied.

CopyToNIPCBuff()

Synopsis

ULONG CopyToNIPCBuff(
         UBYTE * src_data,
         struct NIPCBuff * dest_buff,
         ULONG dstoffset,
         ULONG length );

Function

Copy memory into a buffer's existing entries (within their
nbe_PhysicalLength; nbe_Length grows as needed).

Result

Bytes copied.

CreateEntityA()

Synopsis

struct Entity * CreateEntityA(
         struct TagItem * tags );

struct Entity * CreateEntity(
         TAG tag, ... );

Function

Create an entity, one end of a communication path.

Tags

ENT_Name (STRPTR), ENT_Public (BOOL; needs a name, which must be
unique among public entities of this machine), ENT_Signal (ULONG
bit number) or ENT_AllocSignal (ULONG *).

Result

The entity, or NULL.

DeleteEntity()

Synopsis

void DeleteEntity(
         struct Entity * entity );

Function

Delete an entity made with CreateEntityA(). It stops being findable
at once; connections of clients that found it are reset and queued
requests are returned to them with ENVOYERR_CANTDELIVER; the memory
goes when the last reference does.

DeleteRoute()

Synopsis

APTR DeleteRoute(
         ULONG network );

Function

Route deletion through this interface is not supported on AROS.
The call leaves the routing table unchanged.

Inputs

network - Ignored.

Result

Always NULL. No route object is returned.

Notes

Configure routes through the TCP/IP stack.

DoTransaction()

Synopsis

ULONG DoTransaction(
         struct Entity * dest_entity,
         struct Entity * src_entity,
         struct Transaction * transaction );

Function

BeginTransaction() followed by WaitTransaction().

Result

trans_Error.

FindEntity()

Synopsis

struct Entity * FindEntity(
         CONST_STRPTR hostname,
         CONST_STRPTR entityname,
         struct Entity * src_entity,
         ULONG * detailerror );

Function

Find a public entity on a host and open a path to it from
src_entity. hostname NULL (or this machine's name or address) means
the local machine: the entity itself is returned and no network is
involved. Otherwise the host is located, its resolver asked for the
entity, and a connection opened; the returned link stands for the
remote entity. Every successful call needs a LoseEntity().

Result

The entity or link, or NULL with *detailerror set to
ENVOYERR_UNKNOWNHOST, UNKNOWNENTITY, NORESOLVER or NORESOURCES.

FreeIPProtocol()

Synopsis

void FreeIPProtocol(
         APTR handle );

Function

Perform no operation. AROS does not allocate private IP
protocol handles through this interface.

Inputs

handle - Ignored; may be NULL.

Result

None. No storage is freed and no callback is invoked.

Notes

The handle is not dereferenced. This call cannot release
storage allocated through another interface.

FreeNIPCBuff()

Synopsis

void FreeNIPCBuff(
         struct NIPCBuff * buff );

Function

Free a buffer and its entries. A buffer locked with LockNIPCBuff()
survives one FreeNIPCBuff() per lock.

FreeNIPCBuffEntry()

Synopsis

void FreeNIPCBuffEntry(
         struct NIPCBuffEntry * entry );

Function

Free an entry (not its data unless AllocNIPCBuffEntryWithMem()
provided it). The entry must not be in a buffer.

FreeNIPCEvent()

Synopsis

void FreeNIPCEvent(
         struct NIPCEvent * event );

Function

Free an event in any state; a pending one is cancelled silently.

FreeNIPCEventPort()

Synopsis

void FreeNIPCEventPort(
         struct MsgPort * eventport );

Function

Free an event port (DeleteMsgPort()). Free or abort its events first.

FreeTransaction()

Synopsis

APTR FreeTransaction(
         struct Transaction * transaction );

Function

Free a transaction and the buffers AllocTransactionA() allocated.

FreeUDPPort()

Synopsis

void FreeUDPPort(
         APTR handle );

Function

Perform no operation. AROS does not allocate private UDP
port handles through this interface.

Inputs

handle - Ignored; may be NULL.

Result

None. No storage is freed and no callback is invoked.

Notes

The handle is not dereferenced. This call cannot release
storage allocated through another interface.

GetEntityAttrsA()

Synopsis

ULONG GetEntityAttrsA(
         struct Entity * entity,
         struct TagItem * tagList );

ULONG GetEntityAttrs(
         struct Entity * entity,
         TAG tag, ... );

Function

Read attributes: ENT_Name (with ENT_NameLength), ENT_Public,
ENT_Signal (-1 = none). ti_Data points to where the value goes.

Result

Number of attributes filled in.

GetEntityName()

Synopsis

BOOL GetEntityName(
         struct Entity * entity,
         STRPTR string,
         ULONG maxlen );

Function

Copy the entity's name; "UNNAMED ENTITY" if it has none.

GetHostName()

Synopsis

BOOL GetHostName(
         struct Entity * entity,
         STRPTR string,
         ULONG maxlen );

Function

The name of the host an entity is on: for a link the peer's own
name as it reported it ("realm:host" or "host"); for NULL or a
local entity this machine's name.

Result

FALSE if the buffer is too small.

GetNIPCEvent()

Synopsis

struct NIPCEvent * GetNIPCEvent(
         struct MsgPort * eventport );

Function

The next delivered event at the port, or NULL.

GetNIPCEventCode()

Synopsis

ULONG GetNIPCEventCode(
         struct NIPCEvent * event );

Function

Field of an event.

GetNIPCEventData()

Synopsis

APTR GetNIPCEventData(
         struct NIPCEvent * event );

Function

Field of an event.

GetNIPCEventTime()

Synopsis

ULONG GetNIPCEventTime(
         struct NIPCEvent * event,
         struct timeval * tv,
         BOOL remaining );

Function

For a pending event: the time it was scheduled, or (remaining)
the time left until it is due.

Result

TRUE if the event was pending and tv was filled in.

GetTransaction()

Synopsis

struct Transaction * GetTransaction(
         struct Entity * entity );

Function

Take the next transaction off an entity: a request (returned as
TYPE_SERVICING) or one of the entity's own returning transactions
(TYPE_RESPONSE).

LockNIPCBuff()

Synopsis

void LockNIPCBuff(
         struct NIPCBuff * buff );

Function

Defer the next FreeNIPCBuff() of this buffer.

LoseEntity()

Synopsis

void LoseEntity(
         struct Entity * entity );

Function

Give up a path obtained with FindEntity(). For a remote link the
connection is closed and transactions still pending on it complete
with ENVOYERR_ABORTED.

NIPCBuffLength()

Synopsis

ULONG NIPCBuffLength(
         struct NIPCBuff * buff );

Function

Total data length of a buffer.

NIPCBuffPointer()

Synopsis

UBYTE * NIPCBuffPointer(
         struct NIPCBuff * buff,
         struct NIPCBuffEntry ** beptr,
         ULONG offset );

Function

Address of the byte at offset within the buffer; *beptr receives
the entry that holds it. NULL if the offset is beyond the data.

NIPCControlA()

Synopsis

void NIPCControlA(
         struct TagItem * taglist );

void NIPCControl(
         TAG tag, ... );

Function

Get and set the library's tunables. The RDP settings take effect
for all connections at once. The IP, ARP and fragment settings are
stored and read back but have no effect, since the host stack
handles those layers. NIPCTAG_GetMTUforIP asks the stack for the
MTU of the interface that routes to an address.

NIPCInquiryA()

Synopsis

BOOL NIPCInquiryA(
         struct Hook * hook,
         ULONG maxTime,
         ULONG maxResponses,
         struct TagItem * tagList );

BOOL NIPCInquiry(
         struct Hook * hook,
         ULONG maxTime,
         ULONG maxResponses,
         TAG tag, ... );

Function

Start a network inquiry: the QUERY_#? / MATCH_#? tags are sent to
the hosts of the local network (or, in a realm, through the Realm
Server), repeated once a second for maxTime seconds. The hook is
called for every answer with the answering host's tag list as the
message and the calling task as the object, and once more with a
NULL message when the inquiry ends (after maxTime seconds, after
maxResponses answers, or when the hook returned FALSE). The hook
runs in the library's own process. With maxTime 0 the oldest
pending inquiry using the same hook is aborted.

Result

TRUE if the inquiry was started (or aborted).

PingEntity()

Synopsis

ULONG PingEntity(
         struct Entity * pingtarget,
         ULONG maxTime );

Function

Round-trip time to a remote entity (a link), in microseconds;
0 for a local entity; 0xFFFFFFFF if no answer within maxTime
microseconds.

RegisterIPProtocol()

Synopsis

BOOL RegisterIPProtocol(
         APTR handle );

Function

Private IP protocol registration is not supported on AROS.
No protocol handler is registered.

Inputs

handle - Ignored; may be NULL.

Result

Always FALSE.

Notes

The handle is neither dereferenced nor retained.

RegisterUDPPort()

Synopsis

BOOL RegisterUDPPort(
         APTR handle );

Function

Private UDP port registration is not supported on AROS.
No port is registered.

Inputs

handle - Ignored; may be NULL.

Result

Always FALSE.

Notes

The handle is neither dereferenced nor retained.

ReplyTransaction()

Synopsis

void ReplyTransaction(
         struct Transaction * transaction );

Function

Return a serviced transaction to its sender, with the response data
and trans_Error. For a request that came over the network the
library sends the response and frees the transaction; do not touch
it afterwards.

ScheduleNIPCEvent()

Synopsis

void ScheduleNIPCEvent(
         struct NIPCEvent * event,
         ULONG seconds,
         ULONG micros );

Function

Deliver the event after the given time (immediately if both are 0).
Rescheduling replaces an earlier schedule.

SendICMPMessageA()

Synopsis

ULONG SendICMPMessageA(
         UWORD typeandcode,
         ULONG magicid,
         APTR iphdr,
         ULONG sourceip,
         ULONG destip,
         APTR data,
         ULONG datalen,
         struct TagItem * iptags );

ULONG SendICMPMessage(
         UWORD typeandcode,
         ULONG magicid,
         APTR iphdr,
         ULONG sourceip,
         ULONG destip,
         APTR data,
         ULONG datalen,
         TAG tag, ... );

Function

ICMP transmission through this interface is not supported
on AROS. No message is queued or transmitted.

Inputs

typeandcode - Ignored.
magicid - Ignored.
iphdr - Ignored; may be NULL.
sourceip - Ignored.
destip - Ignored.
data - Ignored; may be NULL.
datalen - Ignored.
iptags - Ignored; may be NULL.

Result

Always zero. This value does not indicate that a message
was sent.

Notes

The header, payload and tag list are neither read nor retained.
Their storage is not freed; ownership remains with the caller.

SendIPPacketA()

Synopsis

void SendIPPacketA(
         struct NIPCBuff * data,
         ULONG srcip,
         ULONG destip,
         UBYTE protocol,
         struct TagItem * iptags );

void SendIPPacket(
         struct NIPCBuff * data,
         ULONG srcip,
         ULONG destip,
         UBYTE protocol,
         TAG tag, ... );

Function

Discard an IP packet by calling FreeNIPCBuff() on its buffer.
No packet is queued or transmitted.

Inputs

data - Buffer obtained from AllocNIPCBuff(), or NULL.
srcip - Ignored.
destip - Ignored.
protocol - Ignored.
iptags - Ignored; may be NULL.

Result

None. The call provides no transmission status.

Notes

An unlocked buffer and its entries are freed before return;
do not access them afterward. Data allocated with an entry
is freed with that entry. Separately supplied entry data
remains caller-owned.

If the buffer has outstanding LockNIPCBuff() calls, one lock
is consumed and the buffer survives this call. These locks
defer freeing; they do not provide mutual exclusion. Prevent
concurrent access to the buffer while this call runs.

NULL has no effect. The tag list is not read or retained.
Call from task context.

SendUDPPacketA()

Synopsis

void SendUDPPacketA(
         APTR dataptr,
         UWORD length,
         ULONG destip,
         UWORD srcport,
         UWORD dstport,
         struct TagItem * iptags );

void SendUDPPacket(
         APTR dataptr,
         UWORD length,
         ULONG destip,
         UWORD srcport,
         UWORD dstport,
         TAG tag, ... );

Function

UDP transmission through this interface is not supported
on AROS. No packet is queued or transmitted.

Inputs

dataptr - Ignored; may be NULL.
length - Ignored.
destip - Ignored.
srcport - Ignored.
dstport - Ignored.
iptags - Ignored; may be NULL.

Result

None. The call provides no transmission status.

Notes

The payload and tag list are neither read nor retained.
Their storage is not freed; ownership remains with the caller.

SetDeviceIPAddressA()

Synopsis

BOOL SetDeviceIPAddressA(
         CONST_STRPTR devicename,
         ULONG unit,
         ULONG ipaddress,
         ULONG mask,
         struct TagItem * tags );

BOOL SetDeviceIPAddress(
         CONST_STRPTR devicename,
         ULONG unit,
         ULONG ipaddress,
         ULONG mask,
         TAG tag, ... );

Function

Interface configuration through this interface is not supported
on AROS. No device is opened and no address or mask is changed.

Inputs

devicename - Ignored; may be NULL.
unit - Ignored.
ipaddress - Ignored.
mask - Ignored.
tags - Ignored; may be NULL.

Result

Always FALSE.

Notes

The device name and tag list are neither read nor retained.
Configure interfaces through the TCP/IP stack.

SetEntityAttrsA()

Synopsis

void SetEntityAttrsA(
         struct Entity * entity,
         struct TagItem * tagList );

void SetEntityAttrs(
         struct Entity * entity,
         TAG tag, ... );

Function

Change attributes: ENT_Public, ENT_Release, ENT_Inherit, ENT_Signal,
ENT_AllocSignal, ENT_TimeoutLinks.

WaitEntity()

Synopsis

void WaitEntity(
         struct Entity * entity );

Function

Wait until a transaction arrives at the entity.

WaitTransaction()

Synopsis

ULONG WaitTransaction(
         struct Transaction * transaction );

Function

Wait until the transaction has completed, then remove it from the
source entity and return trans_Error. Returns at once for a
transaction that was never sent.