;----------------------------------------------------------------------------
;File name:	SLC_TYPE.S			Revision date:	1997.07.27
;C->S Port by:	Ulf Ronald Andersson		Port begun:	1996.08.02
;Original C by:	Dan Ackerman & Steve Adam
;----------------------------------------------------------------------------
;
	include	"uran\STRUCT.SH"
	include	"uran\URAn_SYS.SH"
	include	"stik\GLOBDEFS.SH"
;
slc_type_defined	set	1
;
;----------------------------------------------------------------------------
;
;
slc_type:				;octet	slc_type (b) GPKT *b; {
	XDEF	slc_type		;extern octet slc_type (GPKT *b);
;
;Pure_C_def;	move.l	4(sp),a0	;a0 = b
;
;erase the ';Pure_C_def;' sequence above for CDECL function
;
	move.l	gpkt_fp(a0),a0		;a0 = b->fp
	move.b	(a0),d0			;d0 = *b->fp
	andi	#$F0,d0			;d0 = octet c = *b->fp & 0xf0;
;
	cmpi	#IP_VERSION<<4,d0
	beq.s	.ret_TYPE_IP		;if (c == (IP_VERSION << 4)) return TYPE_IP;
;
	btst	#7,d0
	bne.s	.ret_TYPE_COMP		;if (c & 0x80) { return TYPE_COMPRESSED_TCP; }
;
	cmpi	#TYPE_UNCOMPRESSED_TCP,d0
	beq.s	.ret_TYPE_UNCO		;if (c == TYPE_UNCOMPRESSED_TCP) { return TYPE_UNCOMPRESSED_TCP; }
	moveq	#TYPE_ERROR,d0		;return TYPE_ERROR;
	rts
;
.ret_TYPE_IP:
	moveq	#TYPE_IP,d0
	rts
;
.ret_TYPE_COMP:
	move.l	#TYPE_COMPRESSED_TCP,d0
	rts
;
.ret_TYPE_UNCO:
	moveq	#TYPE_UNCOMPRESSED_TCP,d0
	rts				;}
;
;----------------------------------------------------------------------------
;End of file:	SLC_TYPE.S
;----------------------------------------------------------------------------
