-/*----------------------------------------------------------------------------
- * IPcheck_local_connect
- *
- * Event:
- * A new connection was accept()-ed with IP number `cptr->ip.s_addr'.
- *
- * Action:
- * Update the IPcheck registry.
- * Return:
- * 1 : You're allowed to connect.
- * 0 : You're not allowed to connect.
- *
- * Throttling:
- *
- * A connection should be rejected when a connection from the same IP number was
- * received IPCHECK_CLONE_LIMIT times before this connect attempt, with
- * reconnect intervals of IPCHECK_CLONE_PERIOD seconds or less.
- *
- * Free target inheritance:
- *
- * When the client is accepted, then the number of Free Targets
- * of the cptr is set to the value stored in the found IPregistry
- * structure, or left at STARTTARGETS. This can be done by changing
- * cptr->nexttarget to be `now - (TARGET_DELAY * (FREE_TARGETS - 1))',
- * where FREE_TARGETS may range from 0 till STARTTARGETS.
- *--------------------------------------------------------------------------*/
-int IPcheck_local_connect(struct in_addr a, time_t* next_target_out) {
- assert(0 != next_target_out);
- return ip_registry_check_local(a.s_addr, next_target_out);
-}
-
-
-/*----------------------------------------------------------------------------
- * IPcheck_remote_connect
- *
- * Event:
- * A remote client connected to Undernet, with IP number `cptr->ip.s_addr'
- * and hostname `hostname'.
- *
- * Action:
- * Update the IPcheck registry.
- * Return 0 on failure, 1 on success.
- *--------------------------------------------------------------------------*/
-int IPcheck_remote_connect(struct Client *cptr, int is_burst) {
- assert(0 != cptr);
- return ip_registry_check_remote(cptr, is_burst);
-}
-
-
-/*----------------------------------------------------------------------------
- * IPcheck_connect_fail
- *
- * Event:
- * This local client failed to connect due to legal reasons.
- *
- * Action:
- * Neutralize the effect of calling IPcheck_local_connect, in such
- * a way that the client won't be penalized when trying to reconnect
- * again.
- *--------------------------------------------------------------------------*/
-void IPcheck_connect_fail(struct in_addr a) {
- ip_registry_connect_fail(a.s_addr);
-}
-
-
-/*----------------------------------------------------------------------------
- * IPcheck_connect_succeeded
- *
- * Event:
- * A client succeeded to finish the registration.
- *
- * Finish IPcheck registration of a successfully, locally connected client.
- *--------------------------------------------------------------------------*/
-void IPcheck_connect_succeeded(struct Client *cptr) {
- assert(0 != cptr);
- ip_registry_connect_succeeded(cptr);
-}
-
-
-/*----------------------------------------------------------------------------
- * IPcheck_disconnect
- *
- * Event:
- * A local client disconnected or a remote client left Undernet.
- *
- * Action:
- * Update the IPcheck registry.
- * Remove all expired IPregistry structures from the hash bucket
- * that belongs to this clients IP number.
- *--------------------------------------------------------------------------*/
-void IPcheck_disconnect(struct Client *cptr) {
- assert(0 != cptr);
- ip_registry_disconnect(cptr);
-}
-
-
-/*----------------------------------------------------------------------------
- * IPcheck_nr
- *
- * Returns number of clients with the same IP number
- *--------------------------------------------------------------------------*/
-unsigned short IPcheck_nr(struct Client *cptr) {
- assert(0 != cptr);
- return ip_registry_count(cptr->ip.s_addr);
-}