Codebase list nbtscan-unixwiz / 792277a9-f2af-4f3c-a770-e96ccb17d1b6/main printable_NETBIOS_question_class.c
792277a9-f2af-4f3c-a770-e96ccb17d1b6/main

Tree @792277a9-f2af-4f3c-a770-e96ccb17d1b6/main (Download .tar.gz)

printable_NETBIOS_question_class.c @792277a9-f2af-4f3c-a770-e96ccb17d1b6/mainraw · history · blame

/*
 * $Id: //devel/tools/main/nbtscan/printable_NETBIOS_question_class.c#1 $
 *
 *	When fooling with RFC1002 NETBIOS nameserver queries and responses, we
 *	often wish to decode the question class value in a printable form. We
 *	only have *one* possible value -- "IN" (internet) class -- but to be
 *	consistent we do it this way. Then if we ever have to add more later
 *	everybody gets the benefit.
 */
#ifndef COMMONFILE
# define COMMONFILE "libcommon.h"
#endif
#include COMMONFILE
#include <stdio.h>
#include "penlib.h"

const char * __stdcall printable_NETBIOS_question_class(char *obuf, int qtype)
{
	assert(obuf != 0);

	switch (qtype)
	{
	  case 0x0001:	return "IN";

	  default:	sprintf(obuf, "0x%04x", qtype);
			return obuf;
	}
}