library/src/buffer_analysis/ASCII/BP-BufferAnalysisASCII.cc
// displays what flags are set in the match flags
displays what flags are set in the match flags
displays what flags are set in the match flags
BP_ERROR_T BP_DisplayASCIIStringMatchFlags(BP_FLAGS_T match_flags)
{
	if(!match_flags)
	{
		printf("\n\t [+] No flags set.");
		return ERR_FAILURE;
	}
	printf("\n\t [+] ASCII String Match Flags:");
	printf("\n\t\t negative match:                %s", BP_FLAG_IS_SET(match_flags, BP_ASCII_STRING_SEARCH_NEGATIVE_MATCH) ? "yes" : "no");
	printf("\n\t\t positive match:                %s", BP_FLAG_IS_SET(match_flags, BP_ASCII_STRING_SEARCH_POSITIVE_MATCH) ? "yes" : "no");
	printf("\n\t\t partial positive match:        %s", BP_FLAG_IS_SET(match_flags, BP_ASCII_STRING_SEARCH_PARTIAL_POSITIVE_MATCH) ? "yes" : "no");
	printf("\n\t\t partial negative match:        %s", BP_FLAG_IS_SET(match_flags, BP_ASCII_STRING_SEARCH_PARTIAL_NEGATIVE_MATCH) ? "yes" : "no");
	printf("\n\t\t all search conditions met:     %s", BP_FLAG_IS_SET(match_flags, BP_ASCII_STRING_SEARCH_ALL_SEARCH_FLAG_CONDITIONS_MET) ? "yes" : "no");
	printf("\n\t\t all search conditions met neg: %s", BP_FLAG_IS_SET(match_flags, BP_ASCII_STRING_SEARCH_ALL_SEARCH_FLAG_CONDITIONS_MET_NEGATIVELY) ? "yes" : "no");
	return ERR_SUCCESS;
}
BP_ERROR_T BP_DisplayASCIIStringMatchFlags ( BP_FLAGS_T match_flags ) { if ( ! match_flags ) { printf ( " \n \t " ) ; return ERR_FAILURE ; } printf ( " \n \t " ) ; printf ( " \n \t \t " , BP_FLAG_IS_SET ( match_flags , BP_ASCII_STRING_SEARCH_NEGATIVE_MATCH ) ? " " : " " ) ; printf ( " \n \t \t " , BP_FLAG_IS_SET ( match_flags , BP_ASCII_STRING_SEARCH_POSITIVE_MATCH ) ? " " : " " ) ; printf ( " \n \t \t " , BP_FLAG_IS_SET ( match_flags , BP_ASCII_STRING_SEARCH_PARTIAL_POSITIVE_MATCH ) ? " " : " " ) ; printf ( " \n \t \t " , BP_FLAG_IS_SET ( match_flags , BP_ASCII_STRING_SEARCH_PARTIAL_NEGATIVE_MATCH ) ? " " : " " ) ; printf ( " \n \t \t " , BP_FLAG_IS_SET ( match_flags , BP_ASCII_STRING_SEARCH_ALL_SEARCH_FLAG_CONDITIONS_MET ) ? " " : " " ) ; printf ( " \n \t \t " , BP_FLAG_IS_SET ( match_flags , BP_ASCII_STRING_SEARCH_ALL_SEARCH_FLAG_CONDITIONS_MET_NEGATIVELY ) ? " " : " " ) ; return ERR_SUCCESS ; }
displays what flags are set in the match flags
displays what flags are set in the match flags
// ensure we have at least one flag set // return indicating success