int aw_universe_ejection_add (void)

DESCRIPTION

Blocks all access to the universe from a specific IP address.

CALLBACK

AW_CALLBACK_UNIVERSE_EJECTION_RESULT

NOTES

This method now requires at least SDK build 14 and universe server  build 22.  Note that its behavior has been changed from SDK build 13 and earlier. Previous versions of aw_universe_ejection_add had no callback and specified the address in host byte order.  aw_universe_ejection_add now has a callback and takes the address to block in network byte order, in order to be consistent with other methods in the API that manipulate IP addresses.

Only instances owned by the root account (citizen #1) may use aw_universe_ejection_add.

The attribute AW_EJECTION_ADDRESS specifies the IP address to be ejected (in network byte order.)  If the least significant byte of the address is zero, the entire class C IP address is blocked.  The attribute AW_EJECTION_EXPIRATION_TIME specifies when the ejection will expire.  If AW_EJECTION_EXPIRATION_TIME is set to zero, the ejection never expires.

Beginning with SDK build 16 and universe server build 23, the additional attribute AW_EJECTION_COMMENT can be set to contain an optional text comment to associate with the ejection record.

EXAMPLE

/* block a class C address from accessing the universe for one week */
aw_int_set (AW_EJECTION_ADDRESS, inet_addr ("241.197.54.0"));
aw_int_set (AW_EJECTION_EXPIRATION_TIME, time (NULL) + 7 * 24 * 60 * 60);
aw_string_set (AW_EJECTION_COMMENT, "Keep 'em out for a week");
if (aw_universe_ejection_add ())
  printf ("Unable to add ejection\n");

SEE ALSO

aw_universe_ejection_delete
aw_universe_ejection_lookup
aw_universe_ejection_next
aw_universe_ejection_previous