config.c (113137) | config.c (113325) |
---|---|
1/* $FreeBSD: head/usr.sbin/rtadvd/config.c 113137 2003-04-05 20:54:54Z njl $ */ | 1/* $FreeBSD: head/usr.sbin/rtadvd/config.c 113325 2003-04-10 07:31:34Z suz $ */ |
2/* $KAME: config.c,v 1.37 2001/05/25 07:34:00 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 463 unchanged lines hidden (view full) --- 473 exit(1); 474 } 475 rti->prefixlen = (int)val; 476 477 makeentry(entbuf, sizeof(entbuf), i, "rtrflags", added); 478 MAYHAVE(val, entbuf, 0); 479 rti->rtpref = val & ND_RA_FLAG_RTPREF_MASK; 480 if (rti->rtpref == ND_RA_FLAG_RTPREF_RSV) { | 2/* $KAME: config.c,v 1.37 2001/05/25 07:34:00 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 463 unchanged lines hidden (view full) --- 473 exit(1); 474 } 475 rti->prefixlen = (int)val; 476 477 makeentry(entbuf, sizeof(entbuf), i, "rtrflags", added); 478 MAYHAVE(val, entbuf, 0); 479 rti->rtpref = val & ND_RA_FLAG_RTPREF_MASK; 480 if (rti->rtpref == ND_RA_FLAG_RTPREF_RSV) { |
481 syslog(LOG_ERR, "<%s> invalid router preference", | 481 syslog(LOG_ERR, "<%s> invalid route preference", |
482 __FUNCTION__); 483 exit(1); 484 } 485 486 makeentry(entbuf, sizeof(entbuf), i, "rtrltime", added); 487 /* 488 * XXX: since default value of route lifetime is not defined in 489 * draft-draves-route-selection-01.txt, I took the default --- 561 unchanged lines hidden (view full) --- 1051 for (rti = rainfo->route.next; rti != &rainfo->route; rti = rti->next) { 1052 u_int8_t psize = (rti->prefixlen + 0x3f) >> 6; 1053 1054 ndopt_rti = (struct nd_opt_route_info *)buf; 1055 ndopt_rti->nd_opt_rti_type = ND_OPT_ROUTE_INFO; 1056 ndopt_rti->nd_opt_rti_len = 1 + psize; 1057 ndopt_rti->nd_opt_rti_prefixlen = rti->prefixlen; 1058 ndopt_rti->nd_opt_rti_flags = 0xff & rti->rtpref; | 482 __FUNCTION__); 483 exit(1); 484 } 485 486 makeentry(entbuf, sizeof(entbuf), i, "rtrltime", added); 487 /* 488 * XXX: since default value of route lifetime is not defined in 489 * draft-draves-route-selection-01.txt, I took the default --- 561 unchanged lines hidden (view full) --- 1051 for (rti = rainfo->route.next; rti != &rainfo->route; rti = rti->next) { 1052 u_int8_t psize = (rti->prefixlen + 0x3f) >> 6; 1053 1054 ndopt_rti = (struct nd_opt_route_info *)buf; 1055 ndopt_rti->nd_opt_rti_type = ND_OPT_ROUTE_INFO; 1056 ndopt_rti->nd_opt_rti_len = 1 + psize; 1057 ndopt_rti->nd_opt_rti_prefixlen = rti->prefixlen; 1058 ndopt_rti->nd_opt_rti_flags = 0xff & rti->rtpref; |
1059 ndopt_rti->nd_opt_rti_lifetime = rti->ltime; | 1059 ndopt_rti->nd_opt_rti_lifetime = htonl(rti->ltime); |
1060 memcpy(ndopt_rti + 1, &rti->prefix, psize * 8); 1061 buf += sizeof(struct nd_opt_route_info) + psize * 8; 1062 } 1063#endif 1064 1065 return; 1066} 1067 --- 19 unchanged lines hidden --- | 1060 memcpy(ndopt_rti + 1, &rti->prefix, psize * 8); 1061 buf += sizeof(struct nd_opt_route_info) + psize * 8; 1062 } 1063#endif 1064 1065 return; 1066} 1067 --- 19 unchanged lines hidden --- |