int aw_world_ejection_previous (void)

DESCRIPTION

Queries information about the previous ejection in the world ejection database.

CALLBACK

AW_CALLBACK_WORLD_EJECTION

NOTES

Only instances owned by the world caretaker may use aw_world_ejection_previous.

The attributes AW_EJECTION_TYPE and AW_EJECTION_ADDRESS specify the ejection from which to scan backwards through the database. See aw_world_ejection_add for a complete description of these attributes and how to use them.

If aw_world_ejection_previous succeeds, the following attributes are returned:

AW_EJECTION_TYPE The ejection type
AW_EJECTION_ADDRESS The (previous) blocked IP address
AW_EJECTION_CREATION_TIME When the ejection was first created
AW_EJECTION_EXPIRATION_TIME When the ejection expires
AW_EJECTION_COMMENT Additional text information (optional)

EXAMPLE

/* list all addresses currently blocked from entering the world,
   in reverse order */

aw_int_set (AW_EJECTION_TYPE, AW_EJECT_BY_ADDRESS);
aw_int_set (AW_EJECTION_ADDRESS, 0xffffffff);
while (!aw_world_ejection_previous ()) {
  int address;
  address = aw_int (AW_EJECTION_ADDRESS);
  if (aw_int (AW_EJECTION_TYPE) == AW_EJECT_BY_ADDRESS)
    printf ("%-15s %d\n", inet_ntoa (*(struct in_addr*) &address),
      aw_int (AW_EJECTION_EXPIRATION));
}

SEE ALSO

aw_world_ejection_add
aw_world_ejection_delete
aw_world_ejection_lookup
aw_world_ejection_next