1 |
/* |
/* |
2 |
* Cisco C7200 (Predator) simulation platform. |
* Cisco router simulation platform. |
3 |
* Copyright (c) 2005,2006 Christophe Fillot. All rights reserved. |
* Copyright (c) 2005,2006 Christophe Fillot. All rights reserved. |
4 |
* |
* |
5 |
* Utility functions. |
* Utility functions. |
441 |
|
|
442 |
return(~sum); |
return(~sum); |
443 |
} |
} |
444 |
|
|
445 |
|
/* Byte-swap a memory block */ |
446 |
|
void mem_bswap32(void *ptr,size_t len) |
447 |
|
{ |
448 |
|
m_uint32_t *p = ptr; |
449 |
|
size_t count = len >> 2; |
450 |
|
int i; |
451 |
|
|
452 |
|
for(i=0;i<count;i++,p++) |
453 |
|
*p = swap32(*p); |
454 |
|
} |