[Olsr-cvs] olsrd-current/src net_olsr.c, 1.26, 1.27 net_olsr.h, 1.9, 1.10
Bernd Petrovitsch
(spam-protected)
Mon Aug 20 20:46:05 CEST 2007
Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32673/src
Modified Files:
net_olsr.c net_olsr.h
Log Message:
* cleanup: const'ified parameters
Index: net_olsr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** net_olsr.c 19 Aug 2007 23:00:22 -0000 1.26
--- net_olsr.c 20 Aug 2007 18:46:03 -0000 1.27
***************
*** 522,533 ****
*/
olsr_u16_t
! olsr_netmask_to_prefix(union olsr_ip_addr *adr)
{
! olsr_u16_t prefix;
! int i, tmp;
!
! prefix = 0;
! for(i = 0; i < 16; i++)
{
if(adr->v6.s6_addr[i] == 0xff)
--- 522,531 ----
*/
olsr_u16_t
! olsr_netmask_to_prefix(const union olsr_ip_addr *adr)
{
! int i;
! olsr_u16_t prefix = 0;
! for (i = 0; i < 16; i++)
{
if(adr->v6.s6_addr[i] == 0xff)
***************
*** 537,540 ****
--- 535,539 ----
else
{
+ int tmp;
for(tmp = adr->v6.s6_addr[i];
tmp > 0;
***************
*** 563,572 ****
*/
char *
! sockaddr_to_string(struct sockaddr *address_to_convert)
{
! struct sockaddr_in *address;
!
! address=(struct sockaddr_in *)address_to_convert;
! return(inet_ntoa(address->sin_addr));
}
--- 562,569 ----
*/
char *
! sockaddr_to_string(const struct sockaddr *address_to_convert)
{
! const struct sockaddr_in *address = (const struct sockaddr_in *)address_to_convert;
! return inet_ntoa(address->sin_addr);
}
***************
*** 643,647 ****
void
! olsr_add_invalid_address(union olsr_ip_addr *adr)
{
struct deny_address_entry *new_entry;
--- 640,644 ----
void
! olsr_add_invalid_address(const union olsr_ip_addr *adr)
{
struct deny_address_entry *new_entry;
***************
*** 668,674 ****
*/
olsr_bool
! olsr_validate_address(union olsr_ip_addr *adr)
{
! struct deny_address_entry *deny_entry = deny_entries;
while(deny_entry)
--- 665,671 ----
*/
olsr_bool
! olsr_validate_address(const union olsr_ip_addr *adr)
{
! const struct deny_address_entry *deny_entry = deny_entries;
while(deny_entry)
Index: net_olsr.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** net_olsr.h 25 Apr 2007 22:08:09 -0000 1.9
--- net_olsr.h 20 Aug 2007 18:46:03 -0000 1.10
***************
*** 89,96 ****
olsr_u16_t
! olsr_netmask_to_prefix(union olsr_ip_addr *);
char *
! sockaddr_to_string(struct sockaddr *);
const char *
--- 89,96 ----
olsr_u16_t
! olsr_netmask_to_prefix(const union olsr_ip_addr *);
char *
! sockaddr_to_string(const struct sockaddr *);
const char *
***************
*** 110,117 ****
olsr_bool
! olsr_validate_address(union olsr_ip_addr *);
void
! olsr_add_invalid_address(union olsr_ip_addr *);
#endif
--- 110,117 ----
olsr_bool
! olsr_validate_address(const union olsr_ip_addr *);
void
! olsr_add_invalid_address(const union olsr_ip_addr *);
#endif
More information about the Olsr-cvs
mailing list