[openbeosnetteam] Protocols types
- From: "Waldemar Kornewald" <Waldemar.Kornewald@xxxxxx>
- To: "OpenBeOS Network" <openbeosnetteam@xxxxxxxxxxxxx>
- Date: Thu, 10 Apr 2003 13:13:57 +0200
How are the protocol types managed? The ethernet module has them hard-coded.
Do you think this is a good idea? It is not a big problem to hard-code them
into each module because we maintain and extend the code anyway, but
wouldn't it be better to make a driver configuration file that is loaded by
the core module?
It could look like that:
"ethernet" {
"IP"=0x0800
"ARP"=0x0806
"RARP"=0x8035
}
"IP" {
"TCP"=...
"UDP"=...
"ICMP"=...
}
Each protocol module has one or more protocol names assigned with it (like
"IP"). The core module replaces the string with a pointer to the
corresponding module or NULL if there is no protocol with that name. Each
protocol loads its types like this:
load_protocol_types("ethernet");
Adding a new protocol is very easy. The installer could make a call to
"netprotcfg" to add a new protocol to that file. Adding PPPoE would be very
easy:
netprotcfg -add "ethernet" "PPPoE_Discovery"=0x8863
netprotcfg -add "ethernet" "PPPoE"=0x8864
Then, the module is copied to the protocols directory.
When the ethernet controller receives a PPPoE Discovery packet it iterates
through its protocol list and sees that there is a pointer to a protocol
with a type id 0x8863. Thus, it would just forward this packet to the PPPoE
module.
If we want to specify the supported protocols for each interface we could
change the call to return only supported protocol modules. Then we would
have to tell subprotocols (PPPoE->PPP->IP/Appletalk/X25) which protocols
need support.
Another question is: Is that useful?
No time...must go.
Waldemar
- Follow-Ups:
- [openbeosnetteam] Re: Protocols types
- From: Axel =?iso-8859-1?q?D=F6rfler
Other related posts:
- » [openbeosnetteam] Protocols types
- » [openbeosnetteam] Re: Protocols types
- » [openbeosnetteam] Re: Protocols types
- » [openbeosnetteam] Re: Protocols types
- » [openbeosnetteam] Re: Protocols types
- » [openbeosnetteam] Re: Protocols types
- » [openbeosnetteam] Re: Protocols types
- » [openbeosnetteam] Re: Protocols types
- » [openbeosnetteam] Re: Protocols types
- » [openbeosnetteam] Re: Protocols types
- [openbeosnetteam] Re: Protocols types
- From: Axel =?iso-8859-1?q?D=F6rfler