sap_tables.c (27244) | sap_tables.c (43713) |
---|---|
1/* 2 * Copyright (c) 1995 John Hay. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 14 unchanged lines hidden (view full) --- 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * | 1/* 2 * Copyright (c) 1995 John Hay. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 14 unchanged lines hidden (view full) --- 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * |
31 * $Id: sap_tables.c,v 1.4 1997/07/01 00:33:41 bde Exp $ | 31 * $Id: sap_tables.c,v 1.5 1997/07/06 07:38:33 jhay Exp $ |
32 */ 33 34#include "defs.h" 35#include <string.h> 36#include <stdlib.h> 37 38#define FIXLEN(s) { if ((s)->sa_len == 0) (s)->sa_len = sizeof (*(s));} 39 --- 89 unchanged lines hidden (view full) --- 129 register int besthops = HOPCNT_INFINITY; 130 131 sh = sap_head; 132 133 for (; sh < &sap_head[SAPHASHSIZ]; sh++) 134 for(sap = sh->forw; sap != (sap_entry *)sh; sap = sap->forw) { 135 if (ServType != sap->sap.ServType) 136 continue; | 32 */ 33 34#include "defs.h" 35#include <string.h> 36#include <stdlib.h> 37 38#define FIXLEN(s) { if ((s)->sa_len == 0) (s)->sa_len = sizeof (*(s));} 39 --- 89 unchanged lines hidden (view full) --- 129 register int besthops = HOPCNT_INFINITY; 130 131 sh = sap_head; 132 133 for (; sh < &sap_head[SAPHASHSIZ]; sh++) 134 for(sap = sh->forw; sap != (sap_entry *)sh; sap = sap->forw) { 135 if (ServType != sap->sap.ServType) 136 continue; |
137 if (ifp == sap->ifp) 138 continue; | |
139 | 137 |
140 csap = sap->clone; 141 while (csap) { 142 if (ifp == csap->ifp) 143 /* 144 * I would have loved to use 145 * something else here. 146 */ 147 goto next; 148 csap = csap->clone; 149 } 150 | |
151 if (ntohs(sap->sap.hops) < besthops) { 152 best = sap; 153 besthops = ntohs(best->sap.hops); 154 } 155next:; 156 } 157 return best; 158} --- 177 unchanged lines hidden --- | 138 if (ntohs(sap->sap.hops) < besthops) { 139 best = sap; 140 besthops = ntohs(best->sap.hops); 141 } 142next:; 143 } 144 return best; 145} --- 177 unchanged lines hidden --- |