Aw universe ejection previous

From ActiveWiki
Revision as of 12:05, 26 October 2008 by Macavity (talk | contribs) (Added in, cleanup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Minimum requirements
Added in version 2.2
SDKbuild 14
Universebuild 22


int aw_universe_ejection_previous (void)

Description

Looks up previous blocked IP address in universe ejection database.

Callback

AW_CALLBACK_UNIVERSE_EJECTION

Notes

Only instances owned by the root account (citizen #1 - universe administrators) may use this method.

Arguments

None

Argument attributes

AW_EJECTION_ADDRESS
IP address from which to scan backwards through the database (in network byte order).

Return values

RC_SUCCESS (1) (2)
RC_NOT_INITIALIZED (1)
RC_NO_INSTANCE (1)
RC_NO_CONNECTION (1)
The connection to the universe is down.
RC_DATABASE_ERROR (2)
RC_NO_SUCH_EJECTION (2)

(1) Possible return values when a callback is installed.

(2) Returned by the universe server.

Returned attributes

AW_EJECTION_ADDRESS
AW_EJECTION_CREATION_TIME (1)
AW_EJECTION_EXPIRATION_TIME
AW_EJECTION_COMMENT (1)
(Optional)

(1) Added in version 3.0, SDK build 16 and universe server build 23.

Usage

/* list all addresses currently blocked from the universe in reverse order */

aw_int_set (AW_EJECTION_ADDRESS, 0xffffffff); /* start at 255.255.255.255 */

while (aw_universe_ejection_previous () == RC_SUCCESS)
{
  int address;
  
  address = aw_int (AW_EJECTION_ADDRESS);
  
  printf ("%-15s %d\n", inet_ntoa (*(struct in_addr*) &address),
    aw_int (AW_EJECTION_EXPIRATION_TIME));
}

See also