From owner-p4-projects@FreeBSD.ORG Wed Oct 1 20:47:47 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AEA051065688; Wed, 1 Oct 2008 20:47:47 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7276910656A4 for ; Wed, 1 Oct 2008 20:47:47 +0000 (UTC) (envelope-from rfrench@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6127E8FC13 for ; Wed, 1 Oct 2008 20:47:47 +0000 (UTC) (envelope-from rfrench@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m91KllqX064027 for ; Wed, 1 Oct 2008 20:47:47 GMT (envelope-from rfrench@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m91KllBP064021 for perforce@freebsd.org; Wed, 1 Oct 2008 20:47:47 GMT (envelope-from rfrench@FreeBSD.org) Date: Wed, 1 Oct 2008 20:47:47 GMT Message-Id: <200810012047.m91KllBP064021@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rfrench@FreeBSD.org using -f From: Ryan French To: Perforce Change Reviews Cc: Subject: PERFORCE change 150766 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Oct 2008 20:47:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=150766 Change 150766 by rfrench@rfrench_mpls on 2008/10/01 20:47:35 Finished first version of the fake table entry generator so I can use psuedo entries to test MPLS label operations. Affected files ... .. //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_input.c#10 edit Differences ... ==== //depot/projects/soc2008/rfrench_mpls/netmpls/mpls_input.c#10 (text+ko) ==== @@ -38,6 +38,8 @@ #define MPLS_TTL_GET(l) (ntohl((l) & MPLS_TTL_MASK)) #endif +void create_fake_entry(struct sockaddr_mpls *); + void mpls_init(void) { @@ -50,24 +52,24 @@ } void -create_fake_entry(sockaddr_mpls *smpls) +create_fake_entry(struct sockaddr_mpls *smpls) { if (MPLS_LABEL_GET(smpls->smpls_in_label) == 44) { smpls->smpls_operation = 1; smpls->smpls_out_exp = 14; - smpls->smpls_out_label = 441; + smpls->smpls_out_label = 66; smpls->smpls_out_ifindex = smpls->smpls_in_ifindex; } - if (MPLS_LABEL_GET(smpls->smpls_in_label) == 45) { - smpls->smpls_operation = 1; + if (MPLS_LABEL_GET(smpls->smpls_in_label) == 55) { + smpls->smpls_operation = 2; smpls->smpls_out_exp = 14; - smpls->smpls_out_label = 551; + smpls->smpls_out_label = 44; smpls->smpls_out_ifindex = smpls->smpls_in_ifindex; } if (MPLS_LABEL_GET(smpls->smpls_in_label) == 66) { - smpls->smpls_operation = 1; + smpls->smpls_operation = 3; smpls->smpls_out_exp = 14; - smpls->smpls_out_label = 661; + smpls->smpls_out_label = 1000; smpls->smpls_out_ifindex = smpls->smpls_in_ifindex; } } @@ -177,7 +179,7 @@ smpls = satosmpls(rt_key(rt)); #ifdef MPLS_DEBUG /* Remove this once routing has been setup */ - smpls = create_fake_entry(smpls); + create_fake_entry(smpls); #endif #ifdef MPLS_DEBUG