[Olsr-cvs] olsrd-current/lib/secure/src olsrd_plugin.c, 1.10, 1.11 olsrd_secure.c, 1.21, 1.22

Bernd Petrovitsch (spam-protected)
Fri Apr 20 15:46:05 CEST 2007


Update of /cvsroot/olsrd/olsrd-current/lib/secure/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30814/lib/secure/src

Modified Files:
	olsrd_plugin.c olsrd_secure.c 
Log Message:
cleanup, 1. step (to get some local changes away):
* killed lots of warnings
* added __attribure__((unused)) and __attribure__((format(printf, ..., ...)))
* added "const"
* moved declarations of static functions into .c files
* added "static" declarations
* removed all "inline" declarations. Usually the compiler knows better anyways.
* removed emtpy "return" statements at the end of functions
* localized declarations
* avoided unnecessary data copies
* removed lots of empty lines
There is much more to do.



Index: olsrd_secure.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** olsrd_secure.c	31 Jan 2007 12:36:49 -0000	1.21
--- olsrd_secure.c	20 Apr 2007 13:46:03 -0000	1.22
***************
*** 116,120 ****
  
  int
! secure_plugin_init()
  {
    struct interface *ints;
--- 116,120 ----
  
  int
! secure_plugin_init(void)
  {
    struct interface *ints;
***************
*** 175,179 ****
  
  int
! plugin_ipc_init()
  {
    return 1;
--- 175,179 ----
  
  int
! plugin_ipc_init(void)
  {
    return 1;
***************
*** 185,189 ****
   */
  void
! secure_plugin_exit()
  {
  }
--- 185,189 ----
   */
  void
! secure_plugin_exit(void)
  {
  }
***************
*** 194,198 ****
   */
  void
! olsr_event()
  {
  
--- 194,198 ----
   */
  void
! olsr_event(void)
  {
  
***************
*** 201,205 ****
  
  int
! ipc_send(char *data, int size)
  {
    return 1;
--- 201,205 ----
  
  int
! ipc_send(char *data __attribute__((unused)), int size __attribute__((unused)))
  {
    return 1;
***************
*** 359,363 ****
   */
  int
! check_auth(char *pck, int *size)
  {
  
--- 359,363 ----
   */
  int
! check_auth(char *pck, int *size __attribute__((unused)))
  {
  
***************
*** 427,431 ****
    /* Add timestamp */
    msg->sig.timestamp = htonl(now.tv_sec);
!   olsr_printf(3, "[ENC]timestamp: %d\n", now.tv_sec);
    
    /* Set the new size */
--- 427,431 ----
    /* Add timestamp */
    msg->sig.timestamp = htonl(now.tv_sec);
!   olsr_printf(3, "[ENC]timestamp: %ld\n", now.tv_sec);
    
    /* Set the new size */
***************
*** 594,598 ****
      }
  
!   olsr_printf(1, "[ENC]Received timestamp %d diff: %d\n", rec_time, now.tv_sec - rec_time);
  
    /* Remove signature message */
--- 594,598 ----
      }
  
!   olsr_printf(1, "[ENC]Received timestamp %ld diff: %ld\n", rec_time, now.tv_sec - rec_time);
  
    /* Remove signature message */
***************
*** 685,689 ****
    cmsg.challenge = htonl(challenge);
  
!   olsr_printf(3, "[ENC]Size: %d\n", sizeof(struct challengemsg));
  
    {
--- 685,689 ----
    cmsg.challenge = htonl(challenge);
  
!   olsr_printf(3, "[ENC]Size: %lu\n", (unsigned long)sizeof(struct challengemsg));
  
    {
***************
*** 1057,1061 ****
    /* set timestamp */
    crmsg.timestamp = now.tv_sec;
!   olsr_printf(3, "[ENC]Timestamp %d\n", crmsg.timestamp);
  
    /* Fill subheader */
--- 1057,1061 ----
    /* set timestamp */
    crmsg.timestamp = now.tv_sec;
!   olsr_printf(3, "[ENC]Timestamp %ld\n", crmsg.timestamp);
  
    /* Fill subheader */
***************
*** 1136,1140 ****
    /* set timestamp */
    rrmsg.timestamp = now.tv_sec;
!   olsr_printf(3, "[ENC]Timestamp %d\n", rrmsg.timestamp);
  
    /* Fill subheader */
--- 1136,1140 ----
    /* set timestamp */
    rrmsg.timestamp = now.tv_sec;
!   olsr_printf(3, "[ENC]Timestamp %ld\n", rrmsg.timestamp);
  
    /* Fill subheader */
***************
*** 1219,1223 ****
   */
  void
! timeout_timestamps(void* foo)
  {
    struct stamp *tmp_list;
--- 1219,1223 ----
   */
  void
! timeout_timestamps(void* foo __attribute__((unused)))
  {
    struct stamp *tmp_list;

Index: olsrd_plugin.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_plugin.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** olsrd_plugin.c	29 May 2005 12:47:43 -0000	1.10
--- olsrd_plugin.c	20 Apr 2007 13:46:03 -0000	1.11
***************
*** 64,68 ****
   */
  int 
! olsrd_plugin_interface_version()
  {
    return OLSRD_PLUGIN_INTERFACE_VERSION;
--- 64,68 ----
   */
  int 
! olsrd_plugin_interface_version(void)
  {
    return OLSRD_PLUGIN_INTERFACE_VERSION;
***************
*** 70,79 ****
  
  
- 
  /**
   *Constructor
   */
  static void
! my_init()
  {
    /* Print plugin info to stdout */
--- 70,78 ----
  
  
  /**
   *Constructor
   */
  static void
! my_init(void)
  {
    /* Print plugin info to stdout */
***************
*** 87,91 ****
   */
  static void
! my_fini()
  {
  
--- 86,90 ----
   */
  static void
! my_fini(void)
  {
  
***************
*** 113,117 ****
  
  int
! olsrd_plugin_init() {
    /* Calls the initialization function
     * olsr_plugin_init()
--- 112,116 ----
  
  int
! olsrd_plugin_init(void) {
    /* Calls the initialization function
     * olsr_plugin_init()





More information about the Olsr-cvs mailing list