VirtualBox

Ignore:
Timestamp:
Jan 25, 2010 11:03:51 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56863
Message:

alias_nbt.c: isprint -> RT_C_IS_PRINT; fixes missing prototype warning on darwin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_nbt.c

    r25301 r25992  
    7171# include "alias_local.h"
    7272# include "alias_mod.h"
     73# define isprint RT_C_IS_PRINT
    7374#endif /*VBOX*/
    7475
     
    7778
    7879static int
    79 AliasHandleUdpNbt(struct libalias *, struct ip *, struct alias_link *, 
     80AliasHandleUdpNbt(struct libalias *, struct ip *, struct alias_link *,
    8081          struct in_addr *, u_short);
    8182
     
    8384AliasHandleUdpNbtNS(struct libalias *, struct ip *, struct alias_link *,
    8485            struct in_addr *, u_short *, struct in_addr *, u_short *);
    85 static int 
     86static int
    8687fingerprint1(struct libalias *la, struct ip *pip, struct alias_data *ah)
    8788{
    8889
    89     if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 
     90    if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL ||
    9091        ah->aaddr == NULL || ah->aport == NULL)
    9192        return (-1);
    9293    if (ntohs(*ah->dport) == NETBIOS_DGM_PORT_NUMBER
    93         || ntohs(*ah->sport) == NETBIOS_DGM_PORT_NUMBER)       
     94        || ntohs(*ah->sport) == NETBIOS_DGM_PORT_NUMBER)
    9495        return (0);
    9596    return (-1);
    9697}
    9798
    98 static int 
     99static int
    99100protohandler1(struct libalias *la, struct ip *pip, struct alias_data *ah)
    100101{
    101    
     102
    102103    AliasHandleUdpNbt(la, pip, ah->lnk, ah->aaddr, *ah->aport);
    103104    return (0);
    104105}
    105106
    106 static int 
     107static int
    107108fingerprint2(struct libalias *la, struct ip *pip, struct alias_data *ah)
    108109{
    109110
    110     if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 
     111    if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL ||
    111112        ah->aaddr == NULL || ah->aport == NULL)
    112113        return (-1);
     
    117118}
    118119
    119 static int 
     120static int
    120121protohandler2in(struct libalias *la, struct ip *pip, struct alias_data *ah)
    121122{
    122    
     123
    123124    AliasHandleUdpNbtNS(la, pip, ah->lnk, ah->aaddr, ah->aport,
    124125                ah->oaddr, ah->dport);
     
    126127}
    127128
    128 static int 
     129static int
    129130protohandler2out(struct libalias *la, struct ip *pip, struct alias_data *ah)
    130131{
    131    
     132
    132133    AliasHandleUdpNbtNS(la, pip, ah->lnk, &pip->ip_src, ah->sport,
    133134                ah->aaddr, ah->aport);
     
    138139#ifndef VBOX
    139140struct proto_handler handlers[] = {
    140     { 
    141       .pri = 130, 
    142       .dir = IN|OUT, 
    143       .proto = UDP, 
    144       .fingerprint = &fingerprint1, 
     141    {
     142      .pri = 130,
     143      .dir = IN|OUT,
     144      .proto = UDP,
     145      .fingerprint = &fingerprint1,
    145146      .protohandler = &protohandler1
    146     }, 
    147     { 
    148       .pri = 140, 
    149       .dir = IN, 
    150       .proto = UDP, 
    151       .fingerprint = &fingerprint2, 
     147    },
     148    {
     149      .pri = 140,
     150      .dir = IN,
     151      .proto = UDP,
     152      .fingerprint = &fingerprint2,
    152153      .protohandler = &protohandler2in
    153     }, 
    154     { 
    155       .pri = 140, 
    156       .dir = OUT, 
    157       .proto = UDP, 
    158       .fingerprint = &fingerprint2, 
     154    },
     155    {
     156      .pri = 140,
     157      .dir = OUT,
     158      .proto = UDP,
     159      .fingerprint = &fingerprint2,
    159160      .protohandler = &protohandler2out
    160     }, 
     161    },
    161162    { EOH }
    162163};
    163164#else /* !VBOX */
    164 #define handlers pData->nbt_module 
     165#define handlers pData->nbt_module
    165166#endif /*VBOX*/
    166167
     
    195196    handlers[0].fingerprint = &fingerprint1;
    196197    handlers[0].protohandler = &protohandler1;
    197      
    198    
     198
     199
    199200    handlers[1].pri = 140;
    200201    handlers[1].dir = IN;
     
    202203    handlers[1].fingerprint = &fingerprint2;
    203204    handlers[1].protohandler = &protohandler2in;
    204      
    205    
     205
     206
    206207    handlers[2].pri = 140;
    207208    handlers[2].dir = OUT;
     
    209210    handlers[2].fingerprint = &fingerprint2;
    210211    handlers[2].protohandler = &protohandler2out;
    211      
     212
    212213    handlers[3].pri = EOH;
    213214#endif /*VBOX*/
     
    240241#ifndef VBOX
    241242#ifdef  _KERNEL
    242 static 
     243static
    243244#endif
    244245moduledata_t alias_mod = {
Note: See TracChangeset for help on using the changeset viewer.

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