Subject: Re: uid,gid, and socket protocols
To: Joe Reed <>
From: Andrew Brown <>
List: tech-kern
Date: 09/06/2002 13:59:04
>> >2) how to i determine what protocol a socket is using?  i want to be able
>> > to differentiate between a TCP/UDP/ICMP socket.  i was looking at the
>> > protosw struct, but couln't find the values for the pr_protocol member. 
>> > where are they located?
>> so->so_proto->pr_protocol?
>right, i got that far. there's a pr_type and a pr_protocol in teh protosw 
>struct.  but i cannot seem to find what values of those entries correspond to 
>what protocols (TCP/UDP/ICMP).  am i missing something here, or are those 
>values tucked away somewhere else?

it looks to me like pr_protocol will be one of IPPROTO_UDP,
IPPROTO_TCP, IPPROTO_ICMP, etc.  or perhaps i'm not understanding you?

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."