VirtualBox

Changeset 20086 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
May 27, 2009 2:21:36 PM (16 years ago)
Author:
vboxsync
Message:

NAT/libalias: logging enchancements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/slirp.h

    r20053 r20086  
    375375# endif
    376376#if defined(VBOX_WITH_SLIRP_ALIAS) && defined(VBOX_SLIRP_ALIAS)
    377 # define ip_next(ip) (uintptr_t)((uint8_t *)(ip) + ((ip)->ip_hl << 2))
     377
     378# define ip_next(ip) (void *)((uint8_t *)(ip) + ((ip)->ip_hl << 2))
    378379# define bcopy(src, dst, len) memcpy((dst), (src), (len))
    379380# define NO_FW_PUNCH
     381
    380382# ifdef alias_addr
    381383#  error  alias_addr has already defined!!!
    382384# endif
     385
    383386# define arc4random() RTRandU32()
    384387# undef malloc
     
    395398
    396399# define LIBALIAS_DEBUG
     400
    397401# ifdef fprintf
    398402#   undef fprintf
    399 #   define fprintf vbox_slirp_fprintf
    400403# endif /*fprintf*/
    401 static inline void vbox_slirp_fprintf(void *ignored, char *msg, ...)
     404# define fprintf vbox_slirp_fprintf
     405static void vbox_slirp_fprintf(void *ignored, char *format, ...)
    402406{
    403407/*  define LogIt(pvInst, fFlags, iGroup, fmtargs) */
    404408    va_list args;
    405     register PRTLOGGER LogIt_pLogger;
    406     char buffer[2048];
    407     memset(buffer, 0, 2048);
    408     memcpy(buffer, "NAT: ALIAS:", 11);
    409     va_start(args, msg);
    410     RTStrPrintfV(&buffer[11], 2048 - 11, msg, args);
    411 
    412     LogIt_pLogger = (PRTLOGGER)(LOG_INSTANCE) ?
    413         (PRTLOGGER)(LOG_INSTANCE) : RTLogDefaultInstance();
    414     if (LogIt_pLogger)
    415     {
    416         RTLogPrintfEx(LogIt_pLogger,
    417                 ((RTLOGGRPFLAGS_LEVEL_2) | RTLOGGRPFLAGS_ENABLED), LOG_GROUP,
    418                 msg, buffer);
    419     }
     409    char buffer[1024];
     410    memset(buffer, 0, 1024);
     411    va_start(args, format);
     412    RTStrPrintfV(buffer, 1024, format, args);
    420413    va_end(args);
     414
     415    Log2(("%s\n", buffer));
    421416}
    422417#endif /*VBOX_WITH_SLIRP_ALIAS && VBOX_SLIRP_ALIAS*/
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette