diff -ur --new-file old/atm/BUGS new/atm/BUGS --- old/atm/BUGS Fri Nov 6 16:36:58 1998 +++ new/atm/BUGS Sat Dec 5 01:40:57 1998 @@ -1,6 +1,10 @@ -Known bugs and restrictions in version 0.51 +Known bugs and restrictions in version 0.52 =========================================== + - ENI driver: closing an AAL0 socket while data is arriving at a high rate + hangs in the close system call + - mpcd: adds an MPOA Egress Cache Tag Extension in the MPOA Cache Imposition + Replies it sends even if the extension is missing from the incoming Request - ANS: libresolve conflicts with libc on some systems - ENI driver loses synchronization on some systems, leading to panics or hung VCs (these may be two distinct problems) diff -ur --new-file old/atm/CHANGES new/atm/CHANGES --- old/atm/CHANGES Fri Nov 6 16:36:22 1998 +++ new/atm/CHANGES Sat Dec 5 01:44:40 1998 @@ -1,3 +1,31 @@ +Version 0.51 to 0.52 (5-DEC-1998) +==================== + +Bug fixes +--------- + + - atmsigd crashed when receiving STATUS ENQUIRY for call in Null state + (reported by Heikki Vatiainen) + - outbound endpoint reference didin't have the 16th bit toggled (fixed by + Andrew Lunn) + - lec.c: fixed a bug in kernel which could cause kernel part to deadlock when + signalling was not started successfully (by Heikki Vatiainen) + - MPOA: bug fixes and other changes, see atm/mpoa/CHANGELOG (by Heikki + Vatiainen) + +New features +------------ + + - LANE: both kernel & daemon: support for ELANs which have MTUs greater than + 1516 (by Eric H. Kinzie) + - MPOA: can now ask LECS for configuratino information (by Heikki Vatiainen) + +Other changes +------------- + + - zeppelin.8: updated (Heikki Vatiainen) + + Version 0.50 to 0.51 (6-NOV-1998) ==================== diff -ur --new-file old/atm/README new/atm/README --- old/atm/README Fri Nov 6 16:36:27 1998 +++ new/atm/README Sat Dec 5 01:27:05 1998 @@ -1,4 +1,4 @@ -ATM on Linux, release 0.51 (alpha) by Werner Almesberger, EPFL ICA +ATM on Linux, release 0.52 (alpha) by Werner Almesberger, EPFL ICA ============================================== Werner.Almesberger@epfl.ch This is experimental software. There are known major bugs and certainly diff -ur --new-file old/atm/USAGE new/atm/USAGE --- old/atm/USAGE Fri Nov 6 16:37:41 1998 +++ new/atm/USAGE Sat Dec 5 01:58:08 1998 @@ -1,4 +1,4 @@ -Usage instructions - ATM on Linux, release 0.51 +Usage instructions - ATM on Linux, release 0.52 ------------------------------------------------- For updates of ATM on Linux, please check the Web page at @@ -17,7 +17,7 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.51.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.52.tar.gz - the Linux kernel, version 2.1.126, e.g. from ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.126.tar.gz - Perl, version 4 or 5 @@ -33,7 +33,7 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.51.tar.gz +tar xfz atm-0.52.tar.gz and the kernel source: diff -ur --new-file old/atm/VERSION new/atm/VERSION --- old/atm/VERSION Thu Nov 5 18:26:42 1998 +++ new/atm/VERSION Sat Dec 5 01:27:00 1998 @@ -1 +1 @@ -0.51 +0.52 diff -ur --new-file old/atm/atm.patch new/atm/atm.patch --- old/atm/atm.patch Tue Nov 3 18:56:14 1998 +++ new/atm/atm.patch Sat Dec 5 01:58:02 1998 @@ -14524,8 +14524,8 @@ +}; +#endif /* _ATMLEC_H_ */ --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/include/linux/atmmpc.h Sun Nov 1 15:31:53 1998 -@@ -0,0 +1,99 @@ ++++ work/include/linux/atmmpc.h Sat Dec 5 01:45:34 1998 +@@ -0,0 +1,124 @@ +#ifndef _ATMMPC_H_ +#define _ATMMPC_H_ + @@ -14565,6 +14565,15 @@ + uint16_t holding_time; +} eg_ctrl_info; + ++struct mpc_parameters{ ++ uint16_t mpc_p1; /* Shortcut-Setup Frame Count */ ++ uint16_t mpc_p2; /* Shortcut-Setup Frame Time */ ++ uint8_t mpc_p3[8]; /* Flow-detection Protocols */ ++ uint16_t mpc_p4; /* MPC Initial Retry Time */ ++ uint16_t mpc_p5; /* MPC Retry Time Maximum */ ++ uint16_t mpc_p6; /* Hold Down Time */ ++}; ++ +struct k_message{ + uint16_t type; + uint32_t ip_mask; @@ -14572,6 +14581,7 @@ + union { + in_ctrl_info in_info; + eg_ctrl_info eg_info; ++ struct mpc_parameters params; + } content; + struct atm_qos qos; +} k_message; @@ -14584,6 +14594,16 @@ + uint8_t type[2]; /* Ether type (for IP) (0x0800) */ +}; + ++/* TLVs this MPC recognizes */ ++#define TLV_MPOA_DEVICE_TYPE 0x00a03e2a ++ ++/* MPOA device types in MPOA Device Type TLV */ ++#define NON_MPOA 0 ++#define MPS 1 ++#define MPC 2 ++#define MPS_AND_MPC 3 ++ ++ +/* MPC parameter defaults */ + +#define MPC_P1 10 /* Shortcut-Setup Frame Count */ @@ -14603,11 +14623,11 @@ + +#define SND_MPOA_RES_RQST 201 +#define SET_MPS_CTRL_ADDR 202 -+#define SND_MPOA_RES_RTRY 203 /* Different type in a retry due to req id.*/ ++#define SND_MPOA_RES_RTRY 203 /* Different type in a retry due to req id */ +#define STOP_KEEP_ALIVE_SM 204 +#define EGRESS_ENTRY_REMOVED 205 +#define SND_EGRESS_PURGE 206 -+#define DIE 207 ++#define DIE 207 /* tell the daemon to exit() */ +#define DATA_PLANE_PURGE 208 /* Data plane purge because of egress cache hit miss or dead MPS */ +#define OPEN_INGRESS_SVC 209 + @@ -14619,10 +14639,15 @@ +#define EGRESS_PURGE_RCVD 104 +#define MPS_DEATH 105 +#define CACHE_IMPOS_RCVD 106 -+#define SET_MPC_CTRL_ADDR 107 /* Our MPC's control ATM address */ ++#define SET_MPC_CTRL_ADDR 107 /* Our MPC's control ATM address */ +#define SET_MPS_MAC_ADDR 108 +#define CLEAN_UP_AND_EXIT 109 -+ ++#define SET_MPC_PARAMS 110 /* MPC configuration parameters */ ++ ++/* Message types - bidirectional */ ++ ++#define RELOAD 301 /* kill -HUP the daemon for reload */ ++ +#endif /* _ATMMPC_H_ */ + --- /dev/null Tue Jan 1 05:00:00 1980 @@ -17969,8 +17994,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/lec.c Tue Nov 3 18:41:56 1998 -@@ -0,0 +1,2043 @@ ++++ work/net/atm/lec.c Sat Dec 5 01:49:36 1998 +@@ -0,0 +1,2054 @@ +/* + * lec.c: Lan Emulation driver + * Marko Kiiskila carnil@cs.tut.fi @@ -18093,6 +18118,7 @@ + if (!priv->lecd) { + printk("%s:No lecd attached\n",dev->name); + priv->stats.tx_errors++; ++ dev->tbusy = 1; + return -EUNATCH; + } + if (dev->tbusy) { @@ -18541,6 +18567,15 @@ + return 0; +} + ++/* shamelessly stolen from drivers/net/net_init.c */ ++static int lec_change_mtu(struct device *dev, int new_mtu) ++{ ++ if ((new_mtu < 68) || (new_mtu > 18190)) ++ return -EINVAL; ++ dev->mtu = new_mtu; ++ return 0; ++} ++ +static int +lec_init(struct device *dev) +{ @@ -18551,6 +18586,7 @@ + memset(dev->priv,0,sizeof(struct lec_priv)); + + ether_setup(dev); ++ dev->change_mtu = lec_change_mtu; + dev->hard_header = lec_hard_header; + dev->rebuild_header = lec_rebuild_header; + dev->hard_header_cache = NULL; @@ -20278,8 +20314,8 @@ + +#endif --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/mpc.c Sun Nov 1 15:31:53 1998 -@@ -0,0 +1,1485 @@ ++++ work/net/atm/mpc.c Sat Dec 5 01:50:04 1998 +@@ -0,0 +1,1519 @@ +#include +#include +#include @@ -20338,11 +20374,13 @@ +static void ingress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc); +static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc); +static void mps_death(struct k_message *msg, struct mpoa_client *mpc); -+static void clean_up(struct k_message *msg, struct mpoa_client *mpc); ++static void clean_up(struct k_message *msg, struct mpoa_client *mpc, int action); +static void MPOA_cache_impos_rcvd(struct k_message *msg, struct mpoa_client *mpc); +static void set_mpc_ctrl_addr_rcvd(struct k_message *mesg, struct mpoa_client *mpc); +static void set_mps_mac_addr_rcvd(struct k_message *mesg, struct mpoa_client *mpc); + ++static uint8_t *copy_macs(struct mpoa_client *mpc, uint8_t *router_mac, ++ uint8_t *tlvs, uint8_t mps_macs, uint8_t device_type); +static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry); + +static void send_set_mps_ctrl_addr(char *addr, struct mpoa_client *mpc); @@ -20630,7 +20668,7 @@ +} + +/* -+ * lec device calls this via its dev->priv->lan2_ops->associate_indicator() ++ * lec device calls this via its dev->priv->lane2_ops->associate_indicator() + * when it sees a TLV in LE_ARP packet. + * We fill in the pointer above when we see a LANE2 lec initializing + * See LANE2 spec 3.1.5 @@ -20665,37 +20703,6 @@ + printk("mpoa: (%s) lane2_assoc_ind: TLV type was 0, returning\n", dev->name); + return; + } -+ /* Sampo-Add: start */ -+ switch(type){ -+ case TLV_SC_SETUP_FRAME_COUNT: -+ mpc->parameters.mpc_p1 = (*(tlvs+1)<<8) | (*tlvs); -+ printk("mpoa: lane2_assoc_ind(): MPC_p1 = %d\n",mpc->parameters.mpc_p1); -+ break; -+ case TLV_SC_SETUP_FRAME_TIME: -+ mpc->parameters.mpc_p2 = (*(tlvs+1)<<8) | (*tlvs); -+ printk("mpoa: lane2_assoc_ind(): MPC_p2 = %d\n",mpc->parameters.mpc_p2); -+ break; -+ case TLV_FLOW_DETECTION_PROTOCOLS: -+ memcpy(mpc->parameters.mpc_p3, tlvs, length); -+ printk("mpoa: lane2_assoc_ind(): MPC_p3 = %s\n",mpc->parameters.mpc_p3); -+ break; -+ case TLV_MPC_ININTIAL_RETRY_TIME: -+ mpc->parameters.mpc_p4 = (*(tlvs+1)<<8) | (*tlvs); -+ printk("mpoa: lane2_assoc_ind(): MPC_p4 = %d\n",mpc->parameters.mpc_p4); -+ break; -+ case TLV_MPC_RETRY_TIME_MAXIMUM: -+ mpc->parameters.mpc_p5 = (*(tlvs+1)<<8) | (*tlvs); -+ printk("mpoa: lane2_assoc_ind(): MPC_p5 = %d\n",mpc->parameters.mpc_p5); -+ break; -+ case TLV_HOLD_DOWN_TIME: -+ mpc->parameters.mpc_p6 = (*(tlvs+1)<<8) | (*tlvs); -+ printk("mpoa: lane2_assoc_ind(): MPC_p6 = %d\n",mpc->parameters.mpc_p6); -+ break; -+ default: -+ break; -+ -+ } -+ /* Sampo-Add: end */ + + if (type != TLV_MPOA_DEVICE_TYPE) { + tlvs += length; @@ -20730,25 +20737,8 @@ + /* ok, now we can go and tell our daemon the control address of MPS */ + send_set_mps_ctrl_addr(tlvs, mpc); + -+ tlvs += 20; if (mpoa_device_type == MPS_AND_MPC) tlvs += 20; -+ /* collect the MPS MAC addresses */ -+ if (mpc->number_of_mps_macs < number_of_mps_macs) { -+ kfree(mpc->mps_macs); /* need more space */ -+ mpc->mps_macs = kmalloc(number_of_mps_macs*ETH_ALEN, GFP_KERNEL); -+ if (mpc->mps_macs == NULL) { -+ printk("mpoa: (%s) lane2_assoc_ind: out of mem\n", dev->name); -+ return; -+ } -+ } -+ -+ /* be careful not to zero out any command line MACs */ -+ if (number_of_mps_macs > 0) { -+ mpc->number_of_mps_macs = number_of_mps_macs; -+ while (number_of_mps_macs > 0) { -+ memcpy(mpc->mps_macs, tlvs, ETH_ALEN); -+ tlvs += ETH_ALEN; number_of_mps_macs--; -+ } -+ } ++ tlvs = copy_macs(mpc, mac_addr, tlvs, number_of_mps_macs, mpoa_device_type); ++ if (tlvs == NULL) return; + } + if (end_of_tlvs - tlvs != 0) + printk("mpoa: (%s) lane2_assoc_ind: ignoring %d bytes of trailing TLV carbage\n", @@ -20756,6 +20746,41 @@ + return; +} + ++/* ++ * store either advertizing router's MAC address ++ * or the MAC address(es) in this TLV ++ */ ++static uint8_t *copy_macs(struct mpoa_client *mpc, uint8_t *router_mac, ++ uint8_t *tlvs, uint8_t mps_macs, uint8_t device_type) ++{ ++ int num_macs; ++ num_macs = (mps_macs > 1) ? mps_macs : 1; ++ ++ if (mpc->number_of_mps_macs != num_macs) { ++ kfree(mpc->mps_macs); ++ mpc->number_of_mps_macs = num_macs; ++ mpc->mps_macs = kmalloc(num_macs*ETH_ALEN, GFP_KERNEL); ++ if (mpc->mps_macs == NULL) { ++ printk("mpoa: (%s) copy_macs: out of mem\n", mpc->dev->name); ++ return NULL; ++ } ++ } ++ ++ /* copy the advertizing routers MAC address */ ++ memcpy(mpc->mps_macs, router_mac, ETH_ALEN); ++ ++ tlvs += 20; if (device_type == MPS_AND_MPC) tlvs += 20; ++ /* ++ * collect the MPS MAC addresses. ++ * however, it is possible that TLV includes no MACs ++ */ ++ if (mps_macs > 0) ++ memcpy(mpc->mps_macs, tlvs, mps_macs*ETH_ALEN); ++ tlvs += mps_macs*ETH_ALEN; ++ ++ return tlvs; ++} ++ +/* FIXME: tarvitsee työtä */ +static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc) +{ @@ -21222,8 +21247,16 @@ + break; + case CLEAN_UP_AND_EXIT: + printk(" clean_up_and_exit\n"); -+ clean_up(mesg, mpc); ++ clean_up(mesg, mpc, DIE); + break; ++ case RELOAD: ++ printk(" reload\n"); ++ clean_up(mesg, mpc, RELOAD); ++ break; ++ case SET_MPC_PARAMS: ++ printk(" set_mpc_params\n"); ++ mpc->parameters = mesg->content.params; ++ break; + default: + printk(" unknown message %d\n", mesg->type); + break; @@ -21368,14 +21401,47 @@ + return; +} + ++/* ++ * Things get complicated because we have to check if there's an egress ++ * shortcut with suitable traffic parameters we could use. ++ */ ++static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_client *client, in_cache_entry *entry){ ++ uint32_t dst_ip = msg->content.in_info.in_dst_ip; ++ unsigned char *ip = (unsigned char *)&dst_ip; ++ struct atm_mpoa_qos *qos = atm_mpoa_search_qos(dst_ip); ++ eg_cache_entry *eg_entry = client->eg_ops->search_by_src_ip(dst_ip, client); ++ if(eg_entry && eg_entry->shortcut){ ++ if(eg_entry->shortcut->qos.txtp.traffic_class & ++ msg->qos.txtp.traffic_class & ++ (qos ? qos->qos.txtp.traffic_class : ATM_UBR | ATM_CBR)){ ++ if(eg_entry->shortcut->qos.txtp.traffic_class == ATM_UBR) ++ entry->shortcut = eg_entry->shortcut; ++ else if(eg_entry->shortcut->qos.txtp.max_pcr > 0) ++ entry->shortcut = eg_entry->shortcut; ++ } ++ if(entry->shortcut){ ++ dprintk("mpoa: (%s) using egress SVC to reach %d.%d.%d.%d\n",client->dev->name, ip[0], ip[1], ip[2], ip[3]); ++ return; ++ } ++ } ++ /* No luck in the egress cache we must open an ingress SVC */ ++ msg->type = OPEN_INGRESS_SVC; ++ if (qos && (qos->qos.txtp.traffic_class == msg->qos.txtp.traffic_class)) ++ { ++ msg->qos = qos->qos; ++ printk("mpoa: (%s) trying to get a CBR shortcut\n",client->dev->name); ++ } ++ else memset(&msg->qos,0,sizeof(struct atm_qos)); ++ msg_to_mpoad(msg, client); ++ return; ++} ++ +static void MPOA_res_reply_rcvd(struct k_message *msg, struct mpoa_client *client) +{ + unsigned char *ip; -+ struct atm_mpoa_qos *qos; ++ + uint32_t dst_ip = msg->content.in_info.in_dst_ip; + in_cache_entry *entry = client->in_ops->search(dst_ip, client); -+ eg_cache_entry *eg_entry; -+ + ip = (unsigned char *)&dst_ip; + dprintk("mpoa: (%s) MPOA_res_reply_rcvd: ip %d.%d.%d.%d\n", client->dev->name, ip[0], ip[1], ip[2], ip[3]); + ddprintk("mpoa: (%s) MPOA_res_reply_rcvd() entry = %p", client->dev->name, entry); @@ -21406,6 +21472,9 @@ + client->dev->name); + return; + } ++ ++ check_qos_and_open_shortcut(msg, client, entry); ++#if 0 + + /* entry->shortcut == NULL so we need to get a VC. First check for candicates + * in egress cache. If none found, ask daemon to create one. @@ -21425,7 +21494,7 @@ + msg->type = OPEN_INGRESS_SVC; + qos = atm_mpoa_search_qos(entry->ctrl_info.in_dst_ip); + if (qos != NULL && qos->qos.txtp.traffic_class & msg->qos.txtp.traffic_class) { -+ msg->qos = qos->qos; ++ msg->qos = qos->qos; + printk("mpoa: (%s) MPOA_res_reply_rcvd: trying to get a CBR shortcut\n", + client->dev->name); + } @@ -21435,7 +21504,8 @@ + } + msg_to_mpoad(msg, client); + } -+ ++#endif ++ + entry->entry_state = INGRESS_RESOLVED; + + return; @@ -21625,7 +21695,10 @@ + return; +} + -+static void clean_up(struct k_message *msg, struct mpoa_client *mpc){ ++/* ++ * purge egress cache and tell daemon to 'action' (DIE, RELOAD) ++ */ ++static void clean_up(struct k_message *msg, struct mpoa_client *mpc, int action){ + + unsigned long flags; + eg_cache_entry *entry; @@ -21642,7 +21715,7 @@ + } + read_unlock_irqrestore(&mpc->egress_lock, flags); + -+ msg->type = DIE; ++ msg->type = action; + msg_to_mpoad(msg, mpc); + return; +} @@ -21762,12 +21835,9 @@ + return; +} +#endif /* MODULE */ -+ -+ -+ --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/mpc.h Sun Nov 1 15:31:53 1998 -@@ -0,0 +1,89 @@ ++++ work/net/atm/mpc.h Sat Dec 5 01:50:17 1998 +@@ -0,0 +1,65 @@ +#ifndef _MPC_H_ +#define _MPC_H_ + @@ -21784,15 +21854,6 @@ +int atm_mpoa_mpoad_attach(struct atm_vcc *vcc, int arg); +int atm_mpoa_vcc_attach(struct atm_vcc *vcc, long arg); + -+struct mpc_parameters{ -+ uint16_t mpc_p1; /* Shortcut-Setup Frame Count */ -+ uint16_t mpc_p2; /* Shortcut-Setup Frame Time */ -+ uint8_t mpc_p3[8]; /* Flow-detection Protocols */ -+ uint16_t mpc_p4; /* MPC Initial Retry Time */ -+ uint16_t mpc_p5; /* MPC Retry Time Maximum */ -+ uint16_t mpc_p6; /* Hold Down Time */ -+}; -+ +struct mpoa_client { + struct mpoa_client *next; + struct device *dev; /* lec in question */ @@ -21822,21 +21883,6 @@ + struct atm_qos qos; +}; + -+/* TLVs this MPC recognizes */ -+#define TLV_MPOA_DEVICE_TYPE 0x00a03e2a -+#define TLV_SC_SETUP_FRAME_COUNT 0x00a03e24 /* MPC_p1 */ -+#define TLV_SC_SETUP_FRAME_TIME 0x00a03e25 /* MPC_p2 */ -+#define TLV_FLOW_DETECTION_PROTOCOLS 0x00a03e26 /* MPC_p3 */ -+#define TLV_MPC_ININTIAL_RETRY_TIME 0x00a03e27 /* MPC_p4 */ -+#define TLV_MPC_RETRY_TIME_MAXIMUM 0x00a03e28 /* MPC_p5 */ -+#define TLV_HOLD_DOWN_TIME 0x00a03e29 /* MPC_p6 */ -+ -+/* MPOA device types in MPOA Device Type TLV */ -+#define NON_MPOA 0 -+#define MPS 1 -+#define MPC 2 -+#define MPS_AND_MPC 3 -+ + +/* Functions to call during ioctl(ATMMPC, ) */ +struct atm_mpoa_ops { @@ -21858,7 +21904,7 @@ + +#endif /* _MPC_H_ */ --- /dev/null Tue Jan 1 05:00:00 1980 -+++ work/net/atm/mpoa_caches.c Sun Nov 1 15:31:53 1998 ++++ work/net/atm/mpoa_caches.c Sat Dec 5 01:50:28 1998 @@ -0,0 +1,557 @@ +#include +#include @@ -21992,7 +22038,7 @@ + + if(entry->entry_state == INGRESS_REFRESHING){ + if(entry->count > mpc->parameters.mpc_p1){ -+ msg.type = SND_MPOA_RES_RTRY; ++ msg.type = SND_MPOA_RES_RQST; + msg.content.in_info = entry->ctrl_info; + memcpy(msg.MPS_ctrl, mpc->mps_ctrl_addr, ATM_ESA_LEN); + qos = atm_mpoa_search_qos(entry->ctrl_info.in_dst_ip); diff -ur --new-file old/atm/doc/usage.tex new/atm/doc/usage.tex --- old/atm/doc/usage.tex Fri Nov 6 16:36:48 1998 +++ new/atm/doc/usage.tex Sat Dec 5 01:27:24 1998 @@ -1,7 +1,7 @@ %%def%:= %:\begin{verbatim} -%:Usage instructions - ATM on Linux, release 0.51 +%:Usage instructions - ATM on Linux, release 0.52 %:------------------------------------------------- %: %:\end{verbatim} @@ -38,7 +38,7 @@ \title{ATM on Linux \\ User's guide \\ - Release 0.51 (alpha)} + Release 0.52 (alpha)} \author{Werner Almesberger \\ {\tt Werner.Almesberger@epfl.ch} \\ \\ @@ -82,7 +82,7 @@ In order to install this package, you need \begin{itemize} \item the package itself - \url{ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.51.tar.gz} + \url{ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.52.tar.gz} \item the Linux kernel, version 2.1.126, e.g. from \url{ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.126.tar.gz} \item Perl, version 4 or 5 @@ -99,7 +99,7 @@ distribution: \begin{verbatim} -tar xfz atm-0.51.tar.gz +tar xfz atm-0.52.tar.gz \end{verbatim} and the kernel source: diff -ur --new-file old/atm/doc/usage.txt new/atm/doc/usage.txt --- old/atm/doc/usage.txt Fri Nov 6 16:37:41 1998 +++ new/atm/doc/usage.txt Sat Dec 5 01:58:08 1998 @@ -1,4 +1,4 @@ -Usage instructions - ATM on Linux, release 0.51 +Usage instructions - ATM on Linux, release 0.52 ------------------------------------------------- For updates of ATM on Linux, please check the Web page at @@ -17,7 +17,7 @@ In order to install this package, you need - the package itself - ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.51.tar.gz + ftp://lrcftp.epfl.ch/pub/linux/atm/dist/atm-0.52.tar.gz - the Linux kernel, version 2.1.126, e.g. from ftp://ftp.kernel.org/pub/linux/kernel/v2.1/linux-2.1.126.tar.gz - Perl, version 4 or 5 @@ -33,7 +33,7 @@ all the files listed above there. Then extract the ATM on Linux distribution: -tar xfz atm-0.51.tar.gz +tar xfz atm-0.52.tar.gz and the kernel source: diff -ur --new-file old/atm/led/conn.c new/atm/led/conn.c --- old/atm/led/conn.c Tue Aug 11 16:53:57 1998 +++ new/atm/led/conn.c Sat Dec 5 01:35:52 1998 @@ -882,9 +882,9 @@ int conn_create_listensocket(HANDLE sap_handle, HANDLE conn_context, unsigned short blli_codepoint, const char *qos_spec, - HANDLE *p_conn_handle) + LAN_MTU mtu) { - int fd, ret, len; + int fd, ret, len, sdu; Conn_t *conn; CONN_INFO *conn_info; struct atm_sap atmsap; @@ -906,11 +906,15 @@ switch (blli_codepoint) { case BLLI_CONTROL: - case BLLI_DIRECT_802_3: - case BLLI_BUS_802_3: conn_info->conqos.rxtp.max_sdu = 1516; conn_info->conqos.txtp.max_sdu = 1516; break; + case BLLI_DIRECT_802_3: + case BLLI_BUS_802_3: + sdu = maxframe2maxsdu(mtu); + conn_info->conqos.rxtp.max_sdu = sdu; + conn_info->conqos.txtp.max_sdu = sdu; + break; case BLLI_DIRECT_802_5: case BLLI_BUS_802_5: conn_info->conqos.rxtp.max_sdu = 4544; @@ -984,8 +988,6 @@ EVENT(EM_EVENT,("Listen socket created blli:%2.2x %2.2x\n", conn_info->blli.l3.tr9577.snap[3], conn_info->blli.l3.tr9577.snap[4])); - if (p_conn_handle) - *p_conn_handle = conn; return fd; } @@ -1063,7 +1065,35 @@ return fd; } +int +maxframe2maxsdu(LAN_MTU mtu) +{ + + int sdu; + switch (mtu) { + case MTU_1516: + sdu = 1516; + break; + case MTU_1580: /* LANE2: MTU can be 1580 too (IEEE 802.1p/Q) */ + sdu = 1580; + break; + case MTU_4544: + sdu = 4544; + break; + case MTU_9234: + sdu = 9234; + break; + case MTU_18190: + sdu = 18190; + break; + default: + sdu = 1516; + break; + } + + return sdu; +} /* * * $Log: conn.c,v $ diff -ur --new-file old/atm/led/conn.h new/atm/led/conn.h --- old/atm/led/conn.h Tue Aug 11 16:53:57 1998 +++ new/atm/led/conn.h Sat Dec 5 01:35:57 1998 @@ -13,6 +13,7 @@ #include #include "af_lane.h" +#include "lec.h" /* for LAN_MTU */ void conn_call_callbacks(void); void conn_get_fds(fd_set *fds); @@ -21,8 +22,10 @@ int conn_create_listensocket(HANDLE sap_context, HANDLE conn_context, unsigned short blli_codepoint, const char *qos_spec, - HANDLE *p_conn_handle); + LAN_MTU mtu); int conn_set_kernel_socket(int fd); +int maxframe2maxsdu(LAN_MTU mtu); + /* void conn_convert_to_data_vcc(HANDLE conn_handle); */ diff -ur --new-file old/atm/led/lec_ctrl.c new/atm/led/lec_ctrl.c --- old/atm/led/lec_ctrl.c Mon Oct 5 12:07:00 1998 +++ new/atm/led/lec_ctrl.c Sat Dec 5 01:36:13 1998 @@ -82,7 +82,7 @@ #include "system.h" /* ATM Subsystem Specific Stuff */ #include "g_event.h" #include "lane2.h" /* New stuff in LANE v2 */ - +#include "conn.h" /* for maxframe2maxsdu() */ /* Include Headers for Mapping Module Interfaces. */ #include "af_lane.h" /* ATM Forum LAN Emulation Definitions */ @@ -426,7 +426,7 @@ { LC_ELAN_CONTEXT *p_elan; unsigned int bllicode; - int i; + int i, sdu; EVENT(EM_DEBUG,("Lc_conn_info_make, blli codepoint %x\n",blli_codepoint)); @@ -440,34 +440,14 @@ /* Set the forward and backward Max CPCS-SDU Size */ switch(blli_codepoint) { case BLLI_CONTROL: + p_conn_info->conqos.rxtp.max_sdu = 1516; + p_conn_info->conqos.txtp.max_sdu = 1516; + break; case BLLI_DIRECT_802_3: - case BLLI_BUS_802_3: /* LANE2: MTU can be 1580 too (IEEE 802.1p/Q) */ - switch (p_elan->lec_state.c3_lan_mtu) { - case MTU_1516: - p_conn_info->conqos.rxtp.max_sdu = 1516; - p_conn_info->conqos.txtp.max_sdu = 1516; - break; - case MTU_1580: - p_conn_info->conqos.rxtp.max_sdu = 1580; - p_conn_info->conqos.txtp.max_sdu = 1580; - break; - case MTU_4544: - p_conn_info->conqos.rxtp.max_sdu = 4544; - p_conn_info->conqos.txtp.max_sdu = 4544; - break; - case MTU_9234: - p_conn_info->conqos.rxtp.max_sdu = 9234; - p_conn_info->conqos.txtp.max_sdu = 9234; - break; - case MTU_18190: - p_conn_info->conqos.rxtp.max_sdu = 18190; - p_conn_info->conqos.txtp.max_sdu = 18190; - break; - default: - /* the old version */ - p_conn_info->conqos.rxtp.max_sdu = 1516; - p_conn_info->conqos.txtp.max_sdu = 1516; - } + case BLLI_BUS_802_3: + sdu = maxframe2maxsdu(p_elan->lec_state.c3_lan_mtu); + p_conn_info->conqos.rxtp.max_sdu = sdu; + p_conn_info->conqos.txtp.max_sdu = sdu; break; case BLLI_DIRECT_802_5: case BLLI_BUS_802_5: diff -ur --new-file old/atm/led/main.c new/atm/led/main.c --- old/atm/led/main.c Thu Oct 1 20:02:50 1998 +++ new/atm/led/main.c Sat Dec 5 01:36:26 1998 @@ -270,7 +270,8 @@ { printf("Usage: %s [-c LECS_address]|[-s LES_address] [-e esi] [-n VLAN_name]" " [-m mesg_mask] [-l listen_address] [-i interface_number]" - " [-q qos_spec] [-1] [-2] [-f Fore specific name]\n", progname); + " [-q qos_spec] [-1] [-2] [-f Fore specific name]" + " [-t 1516|1580|4544|9234|18190]\n", progname); } static int @@ -341,7 +342,8 @@ int esi_set=0; ESI mac_addr; LAN_TYPE lan_type = LAN_802_3; - LAN_MTU max_frame_size = MTU_1516; + /* LAN_MTU max_frame_size = MTU_1516; */ + LAN_MTU max_frame_size = MTU_UNSPEC; char p_elan_name[32] = { 00 }; INIT_METHOD init_method = INIT_WELL_KNOWN_LECS; int atm_set=0; @@ -370,7 +372,7 @@ memset(foreId, '\0', FORE_ID_LEN); memset(&preferred_les, 0, sizeof(ADDR_ATM)); while(poll_ret != -1) { - poll_ret = getopt(argc, argv, "c:e:n:s:m:l:i:q:12f:"); + poll_ret = getopt(argc, argv, "c:e:n:s:m:l:i:q:12f:t:"); switch(poll_ret) { case 'c': if (atm_set) { @@ -459,6 +461,13 @@ EVENT(EM_MSG, ("foreId :'%s'\n", foreId)); printf("foreId '%s'\n", foreId); break; + case 't': /* ERIC */ + if( !strncmp( optarg, "1516", 4 )) max_frame_size = MTU_1516; + else if( !strncmp( optarg, "1580", 4 )) max_frame_size = MTU_1580; + else if( !strncmp( optarg, "4544", 4 )) max_frame_size = MTU_4544; + else if( !strncmp( optarg, "9234", 4 )) max_frame_size = MTU_9234; + else if( !strncmp( optarg, "18190", 5 )) max_frame_size = MTU_18190; + break; case -1: break; default: @@ -617,7 +626,7 @@ p_elan->lc_elan_handle, BLLI_CONTROL, qos_spec, - NULL)<0) { + max_frame_size)<0) { EVENT(EM_NERR,("Creating Control blli codepoint failed\n")); return STATUS_K_ATM_RESOURCES; } @@ -625,7 +634,7 @@ p_elan->lc_elan_handle, BLLI_BUS_802_3, qos_spec, - NULL)<0) { + max_frame_size)<0) { EVENT(EM_NERR, ("Creating Bus 802_3 blli codepoint failed\n")); return STATUS_K_ATM_RESOURCES; } @@ -634,7 +643,7 @@ p_elan->lc_elan_handle, BLLI_DIRECT_802_3, qos_spec, - NULL)<0) { + max_frame_size)<0) { EVENT(EM_NERR, ("Creating Data direct 802_3 blli codepoint failed\n")); return STATUS_K_ATM_RESOURCES; } diff -ur --new-file old/atm/led/zeppelin.8 new/atm/led/zeppelin.8 --- old/atm/led/zeppelin.8 Tue Aug 11 16:53:58 1998 +++ new/atm/led/zeppelin.8 Sat Dec 5 01:36:31 1998 @@ -1,4 +1,4 @@ -.TH zeppelin 8 "Jul 29, 1998" "Linux" "Maintenance Commands" +.TH zeppelin 8 "Dec 2, 1998" "Linux" "Maintenance Commands" .SH NAME zeppelin \- ATM LAN Emulation client demon (LED) Zeppelin .SH SYNOPSIS @@ -54,6 +54,9 @@ Linux LEC supports up to 4 network interfaces. This number tells zeppelin to which of these to attach. Network interfaces are numbered from "lec0" to "lec3". +.IP \fB\-t\ \fIMTU\fP +The MTU of ELAN to join. You need to also use \fBifconfig(8)\fP to +set the MTU of the LANE interface. .IP \fB\-1\fP Run as LANEv1 client. This is the default. .IP \fB\-2\fP diff -ur --new-file old/atm/mkdist new/atm/mkdist --- old/atm/mkdist Sun Nov 1 19:30:02 1998 +++ new/atm/mkdist Sat Dec 5 01:43:59 1998 @@ -120,7 +120,8 @@ atm/mpoad/io.c atm/mpoad/io.h atm/mpoad/k_interf.c atm/mpoad/k_interf.h \ atm/mpoad/main.c atm/mpoad/mpcd.8 atm/mpoad/p_factory.c \ atm/mpoad/p_recogn.c atm/mpoad/packets.h atm/mpoad/poll2select.c \ - atm/mpoad/poll2select.h atm/mpoad/tag_list.c \ + atm/mpoad/poll2select.h atm/mpoad/tag_list.c atm/mpoad/lecs.c \ + atm/mpoad/lecs.h \ atm/aqd/Makefile atm/aqd/arequipad.c atm/aqd/io.h atm/aqd/io.c \ atm/aqd/arequipad.8 atm/aqd/aqpvc.c atm/aqd/aqpvc.8 \ atm/switch/Makefile atm/switch/Rules.make atm/switch/cfg.l atm/switch/cfg.y \ diff -ur --new-file old/atm/mpoad/CHANGELOG new/atm/mpoad/CHANGELOG --- old/atm/mpoad/CHANGELOG Fri Oct 30 19:47:38 1998 +++ new/atm/mpoad/CHANGELOG Sat Dec 5 01:43:15 1998 @@ -1,3 +1,23 @@ +Changes from version 0.50 +========================= +o lecs.c: new file. mpcd can now ask LECS for configuration info + if it is given correct command line arguments +o p_recogn.c: added more sanity checks for incoming packets, + fixed possible dereferences of uninitialized variables +o p_recogn.c: receiving MPOA Triggers now works + +o k_interf.c: added missing ntohl() + +o mpc.c: If MPS does not advertise its MAC address with + MPOA Device Discover we take it from LE_ARP packet. + This should remove the need for -m commandline option. + +o both kernel & daemon: killing mpcd with SIGHUP now makes it restart + itself closing all connections and flushing + both ingress and egress cache +o mpcd.8: updated, example added +o README.mpoa: updated + Changes from version 0.46 ========================= o io.c: fixed a misuse of a buffer in set_mps_ctrl_addr() diff -ur --new-file old/atm/mpoad/Makefile new/atm/mpoad/Makefile --- old/atm/mpoad/Makefile Fri Oct 30 19:47:38 1998 +++ new/atm/mpoad/Makefile Sat Dec 5 01:43:15 1998 @@ -1,8 +1,11 @@ LIBS=-latm -OBJS=get_vars.o io.o k_interf.o main.o p_factory.o p_recogn.o id_list.o tag_list.o poll2select.o +OBJS=get_vars.o io.o k_interf.o main.o p_factory.o p_recogn.o id_list.o tag_list.o poll2select.o lecs.o BOOTPGMS=mpcd MAN8= mpcd.8 -CFLAGS_PRIVATE=-DBROKEN_POLL # use select() instead of poll() +# MPOA specific flags +# -DDBROKEN_POLL use select() instead of poll() +# -DMPOA_1_1 use proposed MPOA 1.1 features +CFLAGS_PRIVATE=-DBROKEN_POLL include ../Rules.make diff -ur --new-file old/atm/mpoad/README.mpoa new/atm/mpoad/README.mpoa --- old/atm/mpoad/README.mpoa Fri Oct 30 19:47:38 1998 +++ new/atm/mpoad/README.mpoa Sat Dec 5 01:43:15 1998 @@ -1,8 +1,11 @@ -August 19 1998 +November 5 1998 -This is the first version of MPOA client for Linux. In order to run -MPOA you need to have LANE client (zeppelin) running too. Below is a -snippet from our boot-up script which starts LANE and MPOA. +Short instructions to get MPOA up and running +============================================= + +In order to run MPOA you need to have LANE client (zeppelin) +running too. Below is a snippet from our boot-up script which +starts LANE and MPOA. case "$1" in start) @@ -14,7 +17,7 @@ ilmid/ilmid -b -x fi if [ -x led/zeppelin ] ; then - led/zeppelin -f "Linux 2.1.105/ATM-0.39" -2 -c mpoa-lecs -n sampo -i2 -l jaarlimpc3 & + led/zeppelin -f "Linux 2.1.126/ATM-0.51" -2 -c mpoa-lecs -n sampo -i2 -l jaarlimpc3 & sleep 2 ifconfig lec2 10.10.10.208 \ netmask 255.255.255.192 \ @@ -24,7 +27,7 @@ fi sleep 5 if [ -x mpoad/mpcd ] ; then - mpoad/mpcd -i2 -s jaarlimpc1 -l jaarlimpc2 -m 0000ef06a140 & + mpoad/mpcd -i2 -s jaarlimpc1 -l jaarlimpc2 & fi ;; esac @@ -36,9 +39,6 @@ o different local ATM addresses (jaarlimpc[123]) o -2 option for zeppelin to get it running as a LANEv2 client o default gw being reached via MPOA-enabled LANE interface. - -The MAC address of our router was given by hand because it did not -advertise it's MAC address via MPOA device discovery. Shortcuts, shortcut states and packet counters are available in /proc/atm/mpc diff -ur --new-file old/atm/mpoad/io.c new/atm/mpoad/io.c --- old/atm/mpoad/io.c Fri Oct 30 19:47:39 1998 +++ new/atm/mpoad/io.c Sat Dec 5 01:43:15 1998 @@ -208,7 +208,7 @@ } if (kernel_ok && mps_ok >= 0 && new_ctrl >= 0 && new_shortcut >= 0) continue; /* back to poll() */ - + else break; /* leave main_loop */ } out: diff -ur --new-file old/atm/mpoad/k_interf.c new/atm/mpoad/k_interf.c --- old/atm/mpoad/k_interf.c Fri Oct 30 19:47:39 1998 +++ new/atm/mpoad/k_interf.c Sat Dec 5 01:43:15 1998 @@ -4,6 +4,7 @@ #include #include /* for OPEN_MAX */ #include +#include /* for ntohl() */ #include #include #include "k_interf.h" @@ -98,8 +99,8 @@ break; /* not reached */ case SND_EGRESS_PURGE: dprintf("snd_egress_purge,cache_id = %u.\n",msg.content.eg_info.cache_id); - send_egress_cache_purge_request(1, /* No reply */ - msg.content.eg_info.mps_ip, + send_egress_cache_purge_request(0, /* 1 == no reply, 0 == reply requested */ + ntohl(msg.content.eg_info.mps_ip), 32, get_own_ip_addr(mpc_control.INTERFACE_NUMBER), msg.content.eg_info.cache_id); @@ -110,14 +111,18 @@ exit(0); break; case OPEN_INGRESS_SVC: - dprintf(" open_ingress_svc"); + dprintf(" open_ingress_svc\n"); create_ingress_svc(msg.content.in_info.in_dst_ip, msg.content.in_info.eg_MPC_ATM_addr, msg.qos); return 1; break; + case RELOAD: + printf(" reload\n"); + return 0; + break; default: - dprintf("unknown message %d", msg.type); + dprintf("unknown message %d\n", msg.type); return 0; break; /* not reached */ } diff -ur --new-file old/atm/mpoad/lecs.c new/atm/mpoad/lecs.c --- old/atm/mpoad/lecs.c Thu Jan 1 01:00:00 1970 +++ new/atm/mpoad/lecs.c Sat Dec 5 01:43:16 1998 @@ -0,0 +1,206 @@ +/* lecs.c, get MPOA configuration info from LECS */ + +#include +#include +#include /* htons() and friends */ +#include +#include +#include +#include +#include /* for MPOA Device type TLV */ +#include "lecs.h" +#include "k_interf.h" + +#define MAXFRAME 1024 + +static int get_lecs_socket(struct sockaddr_atmsvc *sa); +static int send_request(int fd, char *buff, char *lec_addr, char *elan_name); +static int get_reply(int fd, char *buff, struct mpc_parameters *params); + +void get_mpc_config(struct sockaddr_atmsvc *sa, char *lec_addr, char *elan_name) +{ + int s; + char buff[MAXFRAME]; + struct k_message msg; + + s = get_lecs_socket(sa); + if (s < 0) return; + + memset(buff, 0, sizeof(buff)); + if (send_request(s, buff, lec_addr, elan_name) < 0) { + printf("mpcd: lecs.c: send_request failed, using defaults\n"); + return; + } + + msg.content.params.mpc_p1 = MPC_P1; + msg.content.params.mpc_p2 = MPC_P2; + msg.content.params.mpc_p4 = MPC_P4; + msg.content.params.mpc_p5 = MPC_P5; + msg.content.params.mpc_p6 = MPC_P6; + + if (get_reply(s, buff, &msg.content.params) < 0) { + printf("mpcd: lecs.c: get_config failed, using defaults\n"); + return; + } + + msg.type = SET_MPC_PARAMS; + send_to_kernel(&msg); + + printf("mpcd: lecs.c: get_config: about to return\n"); + return; +} + +static int send_request(int fd, char *buff, char *lec_addr, char *elan_name) +{ + char *tmp; + int retval; + struct le_config_frame *frame; + + frame = (struct le_config_frame *)buff; + frame->marker = htons(0xff00); + frame->protocol = 0x01; + frame->version = 0x01; + frame->opcode = htons(0x0001); + frame->tran_id = htonl(42); + frame->flags = htons(0x002); + memcpy(frame->src_atm_addr, lec_addr, ATM_ESA_LEN); + frame->num_tlvs = 1; + if (elan_name != NULL) { + strcpy(frame->elan_name, elan_name); + frame->elan_name_size = strlen(elan_name); + } + + /* add the MPOA device type TLV */ + tmp = buff + sizeof(struct le_config_frame); + *(uint32_t *)tmp = htonl(TLV_MPOA_DEVICE_TYPE); + tmp += 4; + + *tmp++ = 22; /* device type field + MPC's ATM address */ + *tmp++ = MPC; + *tmp++ = 0; + memcpy(tmp, lec_addr, ATM_ESA_LEN); tmp += ATM_ESA_LEN; + + retval = write(fd, buff, tmp - buff); + if (retval < 0 || retval != (tmp - buff)) return -1; + + return 0; +} + +static int get_reply(int fd, char *buff, struct mpc_parameters *params) +{ + int retval; + uint32_t type; + uint8_t length, *tlvs, *end_of_tlvs; + struct le_config_frame *frame; + + retval = read(fd, buff, MAXFRAME); + if (retval < 0) return -1; + + frame = (struct le_config_frame *)buff; + if (frame->status != 0) { + printf("mpcd: lecs.c: get_reply: config status %d\n", frame->status); + return -1; + } + if (frame->num_tlvs == 0) { + printf("mpcd: lecs.c: get_reply: no TLVS\n"); + return -1; + } + + tlvs = buff + sizeof(struct le_config_frame); + end_of_tlvs = buff + retval; + while (end_of_tlvs - tlvs >= 5 && frame->num_tlvs-- > 0) { + type = (tlvs[0] << 24) | (tlvs[1] << 16) | (tlvs[2] << 8) | tlvs[3]; + length = tlvs[4]; + tlvs += 5; + /* Sampo-Add: start */ + switch(type){ + case TLV_SC_SETUP_FRAME_COUNT: + params->mpc_p1 = (*(tlvs+1)<<8) | (*tlvs); + params->mpc_p1 = htons(params->mpc_p1); + printf("mpcd: lecs.c: get_reply: MPC_p1 = %d\n",params->mpc_p1); + break; + case TLV_SC_SETUP_FRAME_TIME: + params->mpc_p2 = (*(tlvs+1)<<8) | (*tlvs); + params->mpc_p2 = htons(params->mpc_p2); + printf("mpcd: lecs.c: get_reply: MPC_p2 = %d\n",params->mpc_p2); + break; + case TLV_FLOW_DETECTION_PROTOCOLS: + memcpy(params->mpc_p3, tlvs, length); + printf("mpcd: lecs.c: get_reply: MPC_p3 = %s\n",params->mpc_p3); + break; + case TLV_MPC_ININTIAL_RETRY_TIME: + params->mpc_p4 = (*(tlvs+1)<<8) | (*tlvs); + params->mpc_p4 = htons(params->mpc_p4); + printf("mpcd: lecs.c: get_reply: MPC_p4 = %d\n",params->mpc_p4); + break; + case TLV_MPC_RETRY_TIME_MAXIMUM: + params->mpc_p5 = (*(tlvs+1)<<8) | (*tlvs); + params->mpc_p5 = htons(params->mpc_p5); + printf("mpcd: lecs.c: get_reply: MPC_p5 = %d\n",params->mpc_p5); + break; + case TLV_HOLD_DOWN_TIME: + params->mpc_p6 = (*(tlvs+1)<<8) | (*tlvs); + params->mpc_p6 = htons(params->mpc_p6); + printf("mpcd: lecs.c: get_reply: MPC_p6 = %d\n",params->mpc_p6); + break; + default: + printf("mpcd: lecs.c: get_reply: TLV type 0x%x\n", type); + break; + + } + tlvs += length; + /* Sampo-Add: end */ + } + if (end_of_tlvs - tlvs != 0) + printf("mpcd: lecs.c: get_reply: ignoring %d bytes of trailing TLV carbage\n", + end_of_tlvs - tlvs); + return 1; +} + +static int get_lecs_socket(struct sockaddr_atmsvc *sa) +{ + int s, retval; + struct atm_qos qos; + struct atm_sap sap; + + s = socket(PF_ATMSVC, SOCK_DGRAM, 0); + if (s < 0){ + printf("mpcd: lecs.c: socket failed: %s\n", strerror(errno)); + return -1; + } + memset(&qos, 0, sizeof(qos)); + memset(&sap, 0, sizeof(sap)); + qos.aal = ATM_AAL5; + qos.txtp.traffic_class = ATM_UBR; + qos.rxtp.traffic_class = ATM_UBR; + qos.txtp.max_sdu = 1516; + qos.rxtp.max_sdu = 1516; + if (setsockopt(s, SOL_ATM,SO_ATMQOS, &qos, sizeof(qos)) < 0){ + printf("mpcd: lecs.c: setsockopt SO_ATMQOS failed: %s\n", strerror(errno)); + close(s); + return -1; + } + + sap.blli[0].l2_proto = ATM_L2_NONE; + sap.blli[0].l3_proto = ATM_L3_TR9577; + sap.blli[0].l3.tr9577.ipi = NLPID_IEEE802_1_SNAP; + sap.blli[0].l3.tr9577.snap[0] = 0x00; + sap.blli[0].l3.tr9577.snap[1] = 0xa0; + sap.blli[0].l3.tr9577.snap[2] = 0x3e; + sap.blli[0].l3.tr9577.snap[3] = 0x00; + sap.blli[0].l3.tr9577.snap[4] = 0x01; + if (setsockopt(s, SOL_ATM,SO_ATMSAP, &sap, sizeof(sap)) < 0) { + printf("mpcd: lecs.c: setsockop SO_ATMSAP failed: %s\n", strerror(errno)); + close (s); + return -1; + } + + retval = connect(s, (struct sockaddr *)sa, sizeof(struct sockaddr_atmsvc)); + if (retval < 0) { + printf("mpcd: lecs.c: connect failed: %s\n", strerror(errno)); + close (s); + return -1; + } + + return s; +} diff -ur --new-file old/atm/mpoad/lecs.h new/atm/mpoad/lecs.h --- old/atm/mpoad/lecs.h Thu Jan 1 01:00:00 1970 +++ new/atm/mpoad/lecs.h Sat Dec 5 01:43:16 1998 @@ -0,0 +1,35 @@ +#ifndef LECS_H +#define LECS_H + +void get_mpc_config(struct sockaddr_atmsvc *sa, char *lec_addr, char *elan_name); + +struct le_config_frame { + uint16_t marker; + uint8_t protocol; + uint8_t version; + uint16_t opcode; + uint16_t status; + uint32_t tran_id; + uint16_t lecid; + uint16_t flags; + uint8_t src_lan[8]; + uint8_t target_lan[8]; + uint8_t src_atm_addr[ATM_ESA_LEN]; + uint8_t lan_type; + uint8_t max_frame_size; + uint8_t num_tlvs; + uint8_t elan_name_size; + uint8_t target_atm_addr[ATM_ESA_LEN]; + uint8_t elan_name[32]; + /* TLVs if any */ +} __attribute__ ((packed)); + +/* MPOA Configuration TLVs */ +#define TLV_SC_SETUP_FRAME_COUNT 0x00a03e24 /* MPC_p1 */ +#define TLV_SC_SETUP_FRAME_TIME 0x00a03e25 /* MPC_p2 */ +#define TLV_FLOW_DETECTION_PROTOCOLS 0x00a03e26 /* MPC_p3 */ +#define TLV_MPC_ININTIAL_RETRY_TIME 0x00a03e27 /* MPC_p4 */ +#define TLV_MPC_RETRY_TIME_MAXIMUM 0x00a03e28 /* MPC_p5 */ +#define TLV_HOLD_DOWN_TIME 0x00a03e29 /* MPC_p6 */ + +#endif /* LECS_H */ diff -ur --new-file old/atm/mpoad/main.c new/atm/mpoad/main.c --- old/atm/mpoad/main.c Mon Oct 5 12:07:47 1998 +++ new/atm/mpoad/main.c Sat Dec 5 01:43:16 1998 @@ -19,6 +19,7 @@ #include "io.h" #include "k_interf.h" #include "get_vars.h" +#include "lecs.h" /* * Global struct containing sockets addresses and parameters. @@ -30,12 +31,13 @@ static int set_mps_mac_addr(void); static void usage(const char *progname); -static void signal_handler(int sgnl){ +static void signal_handler(int sig){ struct k_message msg; memset(&msg,0,sizeof(struct k_message)); - msg.type = CLEAN_UP_AND_EXIT; + if (sig == SIGHUP) msg.type = RELOAD; + else msg.type = CLEAN_UP_AND_EXIT; send_to_kernel(&msg); - printf("mpcd: main.c: signal_handler()\n"); + printf("mpcd: main.c: signal_handler() signal %d\n", sig); return; } @@ -48,7 +50,13 @@ struct sockaddr_atmsvc sa; struct atmif_sioc req; int fd; - + unsigned char wellknown_lecs[ATM_ESA_LEN]; + memset(wellknown_lecs,0,ATM_ESA_LEN); + wellknown_lecs[0] = 0x47; + wellknown_lecs[2] = 0x79; + wellknown_lecs[14] = 0xa0; + wellknown_lecs[15] = 0x3e; + wellknown_lecs[18] = 0x01; fd = get_socket(NULL); req.number=0; req.arg=&sa; @@ -59,11 +67,12 @@ } ctrl->sas_family = AF_ATMSVC; data->sas_family = AF_ATMSVC; + mpc_control.lecs_address.sas_family = AF_ATMSVC; /* ATM address for the incoming/outgoing MPOA control connections */ sa.sas_addr.prv[ATM_ESA_LEN-1] = 50; memcpy(ctrl->sas_addr.prv, sa.sas_addr.prv, ATM_ESA_LEN); memcpy(mpc_control.OWN_ATM_ADDRESS, ctrl->sas_addr.prv, ATM_ESA_LEN); - + memcpy(mpc_control.lecs_address.sas_addr.prv,wellknown_lecs, ATM_ESA_LEN); /* ATM address for the incoming/outgoing MPOA shortcuts */ sa.sas_addr.prv[ATM_ESA_LEN-1] = 51; memcpy(data->sas_addr.prv, sa.sas_addr.prv, ATM_ESA_LEN); @@ -78,17 +87,19 @@ struct k_message msg; struct sockaddr_atmsvc control_listen_addr; struct sockaddr_atmsvc mps_ctrl_addr; + struct sockaddr_atmsvc lec_addr; memset(&control_listen_addr,0,sizeof(struct sockaddr_atmsvc)); memset(&mpc_control.data_listen_addr,0,sizeof(struct sockaddr_atmsvc)); + memset(&lec_addr,0,sizeof(struct sockaddr_atmsvc)); memset(&mps_ctrl_addr,0,sizeof(struct sockaddr_atmsvc)); memset(&msg,0,sizeof(struct k_message)); memset(&mpc_control,0,sizeof(mpc_control)); - + mpc_control.elan_name[32] = '\0'; init_default_addresses(&control_listen_addr, &mpc_control.data_listen_addr); while( opt_ret != -1 ){ - opt_ret = getopt(argc, argv, "h:s:l:c:i:m:"); + opt_ret = getopt(argc, argv, "h:s:l:c:L:n:C:i:m:"); switch(opt_ret) { case 'h': usage(argv[0]); @@ -121,6 +132,27 @@ memcpy(mpc_control.MPS_CTRL_ATM_ADDR,mps_ctrl_addr.sas_addr.prv,ATM_ESA_LEN); mpc_control.mps_ctrl_addr_set = 1; break; + case 'L': + if(text2atm(optarg,(struct sockaddr *)&lec_addr, + sizeof(struct sockaddr_atmsvc),T2A_SVC | T2A_NAME)<0){ + printf("mpcd: main.c: text2atm failed.\n"); + usage(argv[0]); + exit(1); + } + memcpy(mpc_control.LEC_ADDRESS,lec_addr.sas_addr.prv,ATM_ESA_LEN); + mpc_control.use_lecs = 1; + break; + case 'n': + strncpy(mpc_control.elan_name,optarg,33); + break; + case 'C': + if(text2atm(optarg,(struct sockaddr *)&mpc_control.lecs_address, + sizeof(struct sockaddr_atmsvc),T2A_SVC | T2A_NAME)<0){ + printf("mpcd: main.c: text2atm failed.\n"); + usage(argv[0]); + exit(1); + } + break; case 'm': strncpy(mpc_control.MPS_MAC_ADDRESS,optarg,13); mpc_control.mps_mac_addr_set = 1; @@ -136,6 +168,9 @@ } while(1){ create_kernel_socket(mpc_control.INTERFACE_NUMBER); + if(mpc_control.use_lecs){ + get_mpc_config(&mpc_control.lecs_address, mpc_control.LEC_ADDRESS, mpc_control.elan_name); + } msg.type = SET_MPC_CTRL_ADDR; memcpy(msg.MPS_ctrl,mpc_control.OWN_ATM_ADDRESS,ATM_ESA_LEN); if (send_to_kernel(&msg) < 0) { @@ -210,7 +245,8 @@ static void usage( const char * progname ){ printf("Usage: %s [-s our_control_listen_ATM_Address] [-l our_data_listen_address]\n" " [-c MPS_control_ATM_Address] [-i interface_number]\n" - " [-m MPS_MAC_address]\n", + " [-m MPS_MAC_address]\n" + " [-L lec_address [-n elan_name [-C lecs_address]]]\n", progname); return; } diff -ur --new-file old/atm/mpoad/mpcd.8 new/atm/mpoad/mpcd.8 --- old/atm/mpoad/mpcd.8 Wed Aug 19 17:07:47 1998 +++ new/atm/mpoad/mpcd.8 Sat Dec 5 01:43:16 1998 @@ -1,51 +1,177 @@ -.TH mpcd 8 "Jul 29, 1998" "Linux" "Maintenance Commands" +.TH mpcd 8 "Nov 17, 1998" "Linux" "Maintenance Commands" .SH NAME mpcd \- ATM MPOA (Multi\-Protocol Over ATM) client daemon .SH SYNOPSIS .B mpcd -.RB [ \-s\ \fIControl\ ATM\ address\fP ] -.RB [ \-l\ \fIData\ ATM\ address\fP ] -.RB [ \-c\ \fIMPS\ control\ ATM\ address\fP ] -.RB [ \-i\ \fIInterface\ number\fP ] -.RB [ \-m\ \fIMPS\ MAC\ address\fP ] +.B [ -s +.I Control ATM address +.B ] +.B [ -l +.I Data ATM address +.B ] +.B [ -c +.I MPS control ATM address +.B ] +.B [ -i +.I Interface number +.B ] +.B [ -m +.I MPS MAC address +.B ] +.B [ -L +.I LEC address +.B [ -n +.I ELAN name +.B ] +.B [ -C +.I LECS Address +.B ]] .SH DESCRIPTION -MPOA client (MPC) is responsible for creating and receiving +MPOA client +.SM(MPC) is responsible for creating and receiving internetwork layer shortcuts. Using these shortcuts MPCs forward unicast internetwork layer packets effectively over ATM without need for routing protocols. .PP -MPC has two roles; ingress and egress. In ingress role MPC detects -flows destined outside it's own subnet and tries to establish -shortcuts to those destinations. In egress role MPC accepts shortcuts -and packets arriving on those shortcuts. Maintaining shortcuts is done -with the help of MPOA server (MPS). +.SM MPC +has two roles; ingress and egress. In ingress role +.SM MPC +detects flows destined outside it's own subnet and tries to establish +shortcuts to those destinations. In egress role +.SM MPC +accepts shortcuts and packets arriving on those shortcuts. Maintaining +shortcuts is done with the help of +.SM MPOA +server +.SM(MPS). .PP -Like Linux LAN Emulation client; MPOA client is also divided in two -parts. The parts are kernel component and an daemon process -\fBmpcd(8)\fP. \fBmpcd(8)\fP opens and receives shortcuts and control -connections with the kernel component. The kernel component tallies -packets flowing in and out and makes the decision if a packet should -be forward using LANE or MPOA shortcuts. +Just as the Linux +.SM LAN +Emulation client, +.SM MPOA +client is also divided in two parts. The parts are kernel component +and a daemon process. The daemon opens and receives data shortcuts and +control connections with the kernel component. The kernel component +tallies packets flowing out from the +.SM LANE +device and makes the decision if a packet should be forwarded using +.SM LANE +or +.SM MPOA +shortcuts. +.PP +If the daemon is killed with +.B SIGHUP +it will close all the open connections, purge ingress and egress cache +entries, query +.SM LECS +if applicable and then restart itself. .PP Linux MPOA client only supports non-LLC-muxed shortcuts. The number of supported MPOA clients is unlimited. .SH OPTIONS -.IP \fB\-s\ \fIControl\ ATM\ address\fP -Local ATM address this MPC used for MPOA control connections. -.IP \fB\-l\ \fIData\ ATM\ address\fP +.IP "-s Control ATM address" +Local ATM address this MPC uses for MPOA control connections. +.IP "-l Data ATM address" Local ATM address from and to which MPOA shortcuts are established. -.IP \fB\-c\ \fIMPS\ control\ ATM\ address\fP -ATM address of MPS. Only needed if MPS can not advertise it by -itself. -.IP \fB\-i\ \fIInterface\ number\fP +.IP "-c MPS control ATM address" +ATM address of MPS. Only needed if MPS can not advertise it by itself. +.IP "-i Interface number" The interface number of LEC this MPC serves. E.g. 2 for "lec2". -.IP \fB\-m\ \fIMPS\ MAC\ address\fP -MAC address of default router where MPS recides. Not needed if MPS can -correctly advertise it via MPOA device discovery. +.IP "-m MPS MAC address" +MAC address of default router where MPS recides. Only useful if the +MPOA server fails to advertise itself. +.IP "-L LEC address" +Listen address of the +.SM LANE +client zeppelin. mpcd uses this address as its own +.SM ATM +address when it queries +.SM LECS +for +.SM MPC +configuration parameters. If this option is not present then mpcd +.B will not +use +.SM LECS +to query for configuration parameters. This option is normally the +same as zeppelin's -l option. +.IP "-n ELAN name" +Name of the +.SM ELAN +for which mpcd asks for parameters when it connects to +.SM LECS. +If this option is not given, +.SM LECS +should respond with parameters belonging to the default +.SM ELAN +if one exists. This option is normally the same as zeppelin's -n +option. +.IP "-C LECS address" +ATM address of +.SM LECS +mpcd asks for parameters. If this option is left empty and -L is +given, mpcd uses ATM Forum assigned Well-Known +.SM LECS +address. This option is normally the same as zeppelin's -c option. +.SH EXAMPLES +This script snippet shows how to run LANE and MPOA. After UNI +signalling and ILMI have been started LANE (zeppelin) and MPOA (mpcd) +are started. The commented out line shows how to start mpcd so that it +queries +.SM LECS +for +.SM MPC +parameters. +.PP +Arguments jaarli[1-3] are local ATM addresses listed in file +.I /etc/hosts.atm. + +ATM=/usr/src/atm +.br +case "$1" in +.br +start) + cd $ATM + if [ -x sigd/atmsigd ] ; then +.RS + sigd/atmsigd -b +.RE + fi + if [ -x ilmid/ilmid ] ; then +.RS + ilmid/ilmid -b -x +.RE + fi + if [ -x led/zeppelin ] ; then +.RS + led/zeppelin -2 -n sampo -i2 -l jaarli3 & + ifconfig lec2 10.10.10.208 \\ +.RS + netmask 255.255.255.192 \\ + broadcast 10.10.10.255 +.RE + ifconfig lec2 up + route add default gw 10.10.10.193 +.RE + fi + if [ -x mpoad/mpcd ] ; then +.RS + mpoad/mpcd -i2 -s jaarli1 -l jaarli2 & + #mpoad/mpcd -i2 -s jaarli1 -l jaarli2 \\ + -L jaarli3 -n sampo & +.RE + fi + ;; +.br +esac +.br +exit 0 .SH BUGS Supports only Ethernet type of ELANs. Probably others too. .SH AUTHORS Heikki Vatiainen , Sampo Saaristo .SH "SEE ALSO" -zeppelin(8), atmsigd(8) -.\"{{{}}} +.BR zeppelin(8), +.BR atmsigd(8) + diff -ur --new-file old/atm/mpoad/p_factory.c new/atm/mpoad/p_factory.c --- old/atm/mpoad/p_factory.c Mon Oct 5 12:07:47 1998 +++ new/atm/mpoad/p_factory.c Sat Dec 5 01:43:16 1998 @@ -184,7 +184,7 @@ dprintf("mpcd: p_factory.c: sending a resolution request %x ",dest_ip); fixed = (struct nhrp_fixed_h *)buff; - prefill_fixed_h(fixed); + prefill_fixed_h(fixed); fixed->ar_op_type = MPOA_RESOLUTION_REQUEST; pos += sizeof(struct nhrp_fixed_h); if( source_ip_present ){ @@ -264,6 +264,7 @@ uint8_t *reply = buffer; memset(reply,0,MAX_PACKET_LENGTH); + memset(&values,0,sizeof(values)); fixed = (struct nhrp_fixed_h *)reply; prefill_fixed_h(fixed); fixed->ar_op_type = MPOA_CACHE_IMPOSITION_REPLY; @@ -294,8 +295,8 @@ pos += sizeof(struct nhrp_cie_short); } fixed_request = (struct nhrp_fixed_h *)request; - - parse_extensions(request+ntohs(fixed_request->ar_extoff),&values); + if(fixed_request->ar_extoff) + parse_extensions(request+ntohs(fixed_request->ar_extoff),&values); fixed->ar_extoff = htons(pos); extension_with_value = (struct nhrp_extension_with_value *)(reply + pos); extension_with_value->type = htons(MPOA_EGRESS_CACHE_TAG_EXTENSION); @@ -357,6 +358,9 @@ new_id(ntohl(common->request_ID),cache_id,MPOA_EGRESS_CACHE_PURGE_REQUEST); prefill_common_h(common); common->dst_protocol_address = ntohl(eg_MPS_ip_addr); +#ifdef MPOA_1_1 + memcpy(common->src_nbma_address, mpc_control.OWN_ATM_ADDRESS, ATM_ESA_LEN); +#endif pos += sizeof(struct nhrp_common_h); cie = (struct nhrp_cie *)(buff + pos); cie->prefix_length = prefix; diff -ur --new-file old/atm/mpoad/p_recogn.c new/atm/mpoad/p_recogn.c --- old/atm/mpoad/p_recogn.c Tue Nov 3 18:37:45 1998 +++ new/atm/mpoad/p_recogn.c Sat Dec 5 01:43:16 1998 @@ -46,6 +46,7 @@ break; case MPOA_EGRESS_CACHE_TAG_EXTENSION: dprintf("mpcd: p_recogn.c: mpoa_egress_cache_tag_extension.\n"); + values->egress_cache_tag_ext_present = 1; extension = (struct nhrp_extension *)(buff + pos); if(ntohs(extension->length)){ values->tag_present = 1; @@ -208,6 +209,8 @@ memcpy(msg.MPS_ctrl, mpc_control.MPS_CTRL_ATM_ADDR, ATM_ESA_LEN); send_to_kernel(&msg); } + + /* we really do not do anything with the extensions, just parse them */ if(ntohs(fixed->ar_extoff)){ pos += parse_extensions(buff + ntohs(fixed->ar_extoff), &values); } @@ -224,6 +227,7 @@ struct nhrp_cie_short * cie_short; struct extension_values values; pos += sizeof( struct nhrp_fixed_h ); + memset(&values, 0, sizeof(struct extension_values)); memset(&msg,0,sizeof(struct k_message)); common = (struct nhrp_common_h *)(buff + pos); memcpy(msg.content.eg_info.in_MPC_data_ATM_addr, @@ -232,11 +236,17 @@ cie_short = (struct nhrp_cie_short *)(buff + pos); msg.content.eg_info.holding_time = ntohs(cie_short->holding_time); msg.ip_mask = calculate_ip_mask(cie_short->prefix_length); - if(ntohs(cie_short->holding_time)) - keep_alive_sm_running = 1; if(ntohs(fixed->ar_extoff)){ pos += parse_extensions(buff + ntohs(fixed->ar_extoff), &values); } + if(ntohs(cie_short->holding_time)) { + if (values.dll_header_present == 0) { + printf("mpcd: p_recogn.c: warning: "); + printf("holding time non-zero but MPOA DLL Header Extension missing\n"); + return 0; + } + keep_alive_sm_running = 1; + } msg.content.eg_info.cache_id = values.dll_ext.cache_id; msg.content.eg_info.DH_length = values.dll_ext.dh_length; memcpy(msg.content.eg_info.DLL_header, values.dll_ext.dll_header, msg.content.eg_info.DH_length); @@ -260,6 +270,7 @@ struct nhrp_cie *cie; struct extension_values values; struct k_message msg; + memset(&values, 0, sizeof(struct extension_values)); memset(&msg,0,sizeof(struct k_message)); pos += sizeof(struct nhrp_fixed_h); common = (struct nhrp_common_h*)(buff + pos); @@ -270,6 +281,16 @@ msg.ip_mask = calculate_ip_mask(cie->prefix_length); if(fixed->ar_extoff) parse_extensions(buff + ntohs(fixed->ar_extoff),&values); + else { + printf("mpcd: p_recogn.c: warning: "); + printf("no extensions in MPOA Egress Cache Purge Reply\n"); + return -1; + } + if (values.dll_header_present == 0) { + printf("mpcd: p_recogn.c: warning: "); + printf("DLL Header Extension missing in MPOA Egress Cache Purge Reply\n"); + return -1; + } msg.content.eg_info.cache_id = values.dll_ext.cache_id; msg.type = EGRESS_PURGE_RCVD; memcpy(msg.MPS_ctrl,mpc_control.MPS_CTRL_ATM_ADDR,ATM_ESA_LEN); @@ -282,6 +303,7 @@ struct nhrp_fixed_h *fixed = (struct nhrp_fixed_h *)buff; struct extension_values values; struct nhrp_common_h_no_ip *common; + memset(&values, 0, sizeof(struct extension_values)); pos += sizeof(struct nhrp_fixed_h); common = (struct nhrp_common_h_no_ip *)(buff + pos); sequence_nmbr = ntohl(common->request_ID); @@ -292,6 +314,7 @@ if(ntohs(fixed->ar_extoff)){ parse_extensions(buff + ntohs(fixed->ar_extoff),&values); } + /* if extensions were missing sequence_nmbr == 0 => MPS Death */ keep_alive_sm(values.keep_alive_lifetime, sequence_nmbr); return 1; } @@ -302,13 +325,27 @@ struct nhrp_common_h *common; struct extension_values values; struct nhrp_fixed_h *fixed = (struct nhrp_fixed_h*)buff; + memset(&values, 0, sizeof(struct extension_values)); pos += sizeof(struct nhrp_fixed_h); common = (struct nhrp_common_h *)(buff + pos); pos += sizeof(struct nhrp_common_h); memset(&msg,0,sizeof(struct k_message)); - if(ntohs(fixed->ar_extoff)) - parse_extensions(buff+ntohs(fixed->ar_extoff),&values); - msg.content.in_info.in_dst_ip = common->dst_protocol_address; + if(ntohs(fixed->ar_extoff)) { + printf("mpcd: p_recogn.c: mpoa_trigger: ar$extoff in Fixed Header != 0\n" ); + parse_extensions(buff+ntohs(fixed->ar_extoff),&values); + } + if(!common->dst_proto_len){ + printf("mpcd: p_recogn.c: mpoa_trigger: no destination ip to trigger! \n"); + return -1; + } + if(common->src_proto_len) + msg.content.in_info.in_dst_ip = common->dst_protocol_address; + /* + * If src_proto_len == 0 dst_protocol_address is found in "place" + * of dst_ptocol_address. + */ + else + msg.content.in_info.in_dst_ip = common->src_protocol_address; memcpy(msg.MPS_ctrl,mpc_control.MPS_CTRL_ATM_ADDR,ATM_ESA_LEN); msg.type = MPOA_TRIGGER_RCVD; send_to_kernel(&msg); @@ -324,6 +361,7 @@ struct nhrp_common_h *common; struct nhrp_cie *cie; struct nhrp_fixed_h *fixed = (struct nhrp_fixed_h*)buff; + memset(&values, 0, sizeof(struct extension_values)); memset(&msg,0,sizeof(struct k_message)); pos += sizeof(struct nhrp_fixed_h); common = (struct nhrp_common_h*)(buff + pos); @@ -338,8 +376,19 @@ msg.content.in_info.holding_time = ntohs(cie->holding_time); if(fixed->ar_extoff) pos += parse_extensions(buff + ntohs(fixed->ar_extoff), &values); + if (values.egress_cache_tag_ext_present == 0) { + printf("mpcd: p_recogn.c: warning: "); + printf("received MPOA Resolution Reply "); + printf("with no Egress Cache Tag Extension\n"); + } + if(values.tag_present && values.tag == 0) { + printf("mpcd: p_recogn.c: warning: "); + printf("received MPOA Resolution Reply "); + printf("with Egress Cache Tag Extension where tag == 0\n"); + values.tag_present = 0; + } if(values.tag_present){ - msg.content.in_info.tag = values.tag; + msg.content.in_info.tag = values.tag; } msg.type = MPOA_RES_REPLY_RCVD; msg.content.in_info.in_dst_ip = common->dst_protocol_address; @@ -382,6 +431,10 @@ if(!checksum_check(buff)){ printf("mpcd: p_recogn.c: checksum error!\n"); return -1; + } + if (fixed->ar_extoff > (fixed->ar_pktsz - sizeof(struct nhrp_extension))) { + printf("mpcd: p_recogn.c: extension offset beyond packet limits!\n"); + return -1; } type = fixed->ar_op_type; dprintf("mpcd: p_recogn.c: "); diff -ur --new-file old/atm/mpoad/packets.h new/atm/mpoad/packets.h --- old/atm/mpoad/packets.h Mon Oct 5 12:07:47 1998 +++ new/atm/mpoad/packets.h Sat Dec 5 01:43:16 1998 @@ -1,5 +1,6 @@ #include #include + #ifndef PACKETS_H #define PACKETS_H @@ -12,8 +13,12 @@ int mps_mac_addr_set; unsigned char MPS_MAC_ADDRESS[13]; unsigned char OWN_ATM_ADDRESS[ATM_ESA_LEN];/* Our control ATM address */ - struct sockaddr_atmsvc data_listen_addr; /* Our data listen address */ - int INTERFACE_NUMBER; /* Interface number, x for lecx */ + struct sockaddr_atmsvc data_listen_addr; /* Our data listen address */ + int use_lecs; /* Use LECS for configuration info */ + struct sockaddr_atmsvc lecs_address; + unsigned char LEC_ADDRESS[ATM_ESA_LEN]; + unsigned char elan_name[33]; + int INTERFACE_NUMBER; /* Interface number, x for lecx */ }; @@ -244,6 +249,7 @@ struct extension_values{ uint32_t dll_header_present; struct dll_header_extension dll_ext; + uint32_t egress_cache_tag_ext_present; uint32_t tag_present; uint32_t tag; uint32_t service_category_present; diff -ur --new-file old/atm/sigd/proto.h new/atm/sigd/proto.h --- old/atm/sigd/proto.h Tue Nov 3 17:23:56 1998 +++ new/atm/sigd/proto.h Wed Dec 2 18:46:23 1998 @@ -1,6 +1,6 @@ /* proto.h - Common protocol functions and structures */ -/* Written 1995-1998 by Werner Almesberger, EPFL-LRC */ +/* Written 1995-1998 by Werner Almesberger, EPFL-LRC/ICA */ #ifndef PROTO_H @@ -78,7 +78,7 @@ /* --- UNI information ------------------------------------------------- */ CALL_STATE call_state; unsigned long call_ref; /* bit 24 like when sending */ - short ep_ref; /* endpoint reference; -1 for p2p */ + short ep_ref; /* endpoint reference value when sending ; -1 for p2p */ TIMER *conn_timer; /* current connection timer */ /* --- some meta-information ------------------------------------------- */ struct _socket *listen; /* to pending connections, also used for "more" */ diff -ur --new-file old/atm/sigd/uni.c new/atm/sigd/uni.c --- old/atm/sigd/uni.c Sun Nov 1 16:57:28 1998 +++ new/atm/sigd/uni.c Wed Dec 2 18:45:17 1998 @@ -103,7 +103,7 @@ this->call_state = cs_in_proc; this->call_ref = call_ref; if (q_present(&in_dsc,QF_ep_ref)) - this->ep_ref = q_fetch(&in_dsc,QF_ep_ref); + this->ep_ref = q_fetch(&in_dsc,QF_ep_ref) ^ 0x8000; #ifdef CISCO else #endif @@ -749,14 +749,14 @@ return; } if (mid == ATM_MSG_STATUS_ENQ) { - send_status(curr->sig,curr,call_ref,ATM_CV_RESP_STAT_ENQ); + send_status(sig,curr,call_ref,ATM_CV_RESP_STAT_ENQ); return; } if (curr && q_present(&in_dsc,QF_ep_ref) && mid != ATM_MSG_ADD_PARTY && mid != ATM_MSG_DROP_PARTY_ACK) - if (curr->ep_ref != q_fetch(&in_dsc,QF_ep_ref)) { - send_drop_party_ack(sig,call_ref,q_fetch(&in_dsc,QF_ep_ref), - ATM_CV_INV_EPR); + if (curr->ep_ref != q_fetch(&in_dsc,QF_ep_ref) ^ 0x8000) { + send_drop_party_ack(sig,call_ref, + q_fetch(&in_dsc,QF_ep_ref) ^ 0x8000,ATM_CV_INV_EPR); return; } if (!curr || curr->call_state == cs_null) { .