src/ap/accounting.c
int accounting_init(struct hostapd_data *hapd)
{
	struct os_time now;

	/* Acct-Session-Id should be unique over reboots. Using a random number
	 * is preferred. If that is not available, take the current time. Mix
	 * in microseconds to make this more likely to be unique. */
	os_get_time(&now);
	if (os_get_random((u8 *) &hapd->acct_session_id_hi,
			  sizeof(hapd->acct_session_id_hi)) < 0)
		hapd->acct_session_id_hi = now.sec;
	hapd->acct_session_id_hi ^= now.usec;

	if (radius_client_register(hapd->radius, RADIUS_ACCT,
				   accounting_receive, hapd))
		return -1;

	accounting_report_state(hapd, 1);

	return 0;
}
/**
 * accounting_init: Initialize accounting
 * @hapd: hostapd BSS data
 * Returns: 0 on success, -1 on failure
 */
Initialize accounting
@hapd: hostapd BSS data
Returns: 0 on success, -1 on failure
Initialize accounting @hapd : hostapd BSS data Returns : 0 on success - 1 on failure
int accounting_init(struct hostapd_data *hapd)
{
	struct os_time now;
	os_get_time(&now);
	if (os_get_random((u8 *) &hapd->acct_session_id_hi,
			  sizeof(hapd->acct_session_id_hi)) < 0)
		hapd->acct_session_id_hi = now.sec;
	hapd->acct_session_id_hi ^= now.usec;
	if (radius_client_register(hapd->radius, RADIUS_ACCT,
				   accounting_receive, hapd))
		return -1;
	accounting_report_state(hapd, 1);
	return 0;
}
int accounting_init ( struct hostapd_data * hapd ) { struct os_time now ; os_get_time ( & now ) ; if ( os_get_random ( ( u8 * ) & hapd -> acct_session_id_hi , sizeof ( hapd -> acct_session_id_hi ) ) < 0 ) hapd -> acct_session_id_hi = now . sec ; hapd -> acct_session_id_hi ^= now . usec ; if ( radius_client_register ( hapd -> radius , RADIUS_ACCT , accounting_receive , hapd ) ) return -1 ; accounting_report_state ( hapd , 1 ) ; return 0 ; }
accounting_init: Initialize accounting
 @hapd: hostapd BSS data
 Returns: 0 on success, -1 on failure
accounting_init : Initialize accounting @hapd : hostapd BSS data Returns : 0 on success - 1 on failure
/* Acct-Session-Id should be unique over reboots. Using a random number
	 * is preferred. If that is not available, take the current time. Mix
	 * in microseconds to make this more likely to be unique. */