library/src/os_profiling/BP_OSProfiling.cc
// generate user information about a system
generate user information about a system
generate user information about a system
BP_ERROR_T BP_OSProfDisplayUserStats(P_BP_OS_PROFILING_SESSION osprof_session)
{
	if(!osprof_session)
		return ERR_FAILURE;
	if(!osprof_session->users)
		return ERR_FAILURE;
	BP_OSPROF_SESSION_LOCK;
	printf("\n [+] OSProf - User Information: ");
	printf("\n [+] user entries: %i", osprof_session->users_n);
	size_t n = 0;
	for(; n < osprof_session->users_n; n++)
	{
		printf("\n [+] User Entry:");
		printf("\n\t username:    %s", osprof_session->users[n].login_name);
		printf("\n\t device:      %s", osprof_session->users[n].device);
		printf("\n\t hostname:    %s", osprof_session->users[n].hostname);
		printf("\n\t record_id:   %s", osprof_session->users[n].record_id);
		printf("\n");
	}
	BP_OSPROF_SESSION_UNLOCK;
	return ERR_SUCCESS;
}
BP_ERROR_T BP_OSProfDisplayUserStats ( P_BP_OS_PROFILING_SESSION osprof_session ) { if ( ! osprof_session ) return ERR_FAILURE ; if ( ! osprof_session -> users ) return ERR_FAILURE ; BP_OSPROF_SESSION_LOCK ; printf ( " \n " ) ; printf ( " \n " , osprof_session -> users_n ) ; size_t n = 0 ; for ( ; n < osprof_session -> users_n ; n ++ ) { printf ( " \n " ) ; printf ( " \n \t " , osprof_session -> users [ n ] . login_name ) ; printf ( " \n \t " , osprof_session -> users [ n ] . device ) ; printf ( " \n \t " , osprof_session -> users [ n ] . hostname ) ; printf ( " \n \t " , osprof_session -> users [ n ] . record_id ) ; printf ( " \n " ) ; } BP_OSPROF_SESSION_UNLOCK ; return ERR_SUCCESS ; }
generate user information about a system
generate user information about a system
// lock session before display // display banner // walk entries // unlock // return indicating success