VirtualBox

Changeset 26495 in vbox


Ignore:
Timestamp:
Feb 14, 2010 7:59:48 AM (15 years ago)
Author:
vboxsync
Message:

Devices: whitespace cleanup

Location:
trunk/src/VBox/Devices
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r26467 r26495  
    11351135     * CPU frequencies
    11361136     */
    1137     // @todo: we need to have VMM API to access TSC increase speed, for now provide reasonable default 
     1137    // @todo: we need to have VMM API to access TSC increase speed, for now provide reasonable default
    11381138    pThis->u64TscFrequency = 2500000000; // TMCpuTicksPerSecond(PDMDevHlpGetVM(pDevIns));
    11391139    /* Multiplier is read from MSR_IA32_PERF_STATUS, and now is hardcoded as 4 */
  • trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/VBoxConsoleDxe/VBoxConsole.c

    r26464 r26495  
    3030static EFI_GUID gVBoxConsoleVarGuid = { 0xb53865fd, 0xb76c, 0x4433, { 0x9e, 0x85, 0xc0, 0xca, 0xdf, 0x65, 0xaa, 0xb8}};
    3131
    32 static EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOutputProtocol; 
     32static EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOutputProtocol;
    3333static EFI_GRAPHICS_OUTPUT_PROTOCOL    *Gop;
    3434static EFI_UGA_DRAW_PROTOCOL           *Uga;
     
    7070        GetVmVariable(EFI_INFO_INDEX_GOP_MODE, (CHAR8 *)&mode, sizeof(UINT32));
    7171        r = Gop->SetMode(Gop, mode);
    72     } 
     72    }
    7373    else if (Uga)
    7474    {
     
    116116            return r;
    117117        }
    118    
     118
    119119        r = gBS->LocateProtocol(&gEfiSimpleTextOutProtocolGuid, NULL, (VOID **)&TextOutputProtocol);
    120120        if(EFI_ERROR(r))
  • trunk/src/VBox/Devices/Graphics/BIOS/clext.c

    r11982 r26495  
    1717//  License along with this library; if not, write to the Free Software
    1818//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
    19 // 
     19//
    2020
    2121
  • trunk/src/VBox/Devices/Graphics/BIOS/tests/testbios.c

    r1 r26495  
    1 /* 
     1/*
    22   This is a little turbo C program that executes
    33   several int10, and let you inspect the content
     
    169169 printf("Writing from %04x:%04x\n",regs->r_es,regs->r_bp);
    170170 intr(0x10,regs);
    171  
     171
    172172}
    173173
     
    203203 printf("r. switch to 50 lines\n");
    204204 c=getche();
    205  
     205
    206206 switch(c)
    207207  {case 'a':
     
    253253 while(kbhit()==0);
    254254 c=getch();
    255  
     255
    256256 return 0;
    257257}
     
    340340
    341341 directvideo=0;
    342  
     342
    343343 while(1)
    344344  {
  • trunk/src/VBox/Devices/Graphics/BIOS/vbe.h

    r7759 r26495  
    2020// The official VBE Information Block
    2121typedef struct VbeInfoBlock
    22 { 
     22{
    2323   Bit8u  VbeSignature[4];
    2424   Bit16u VbeVersion;
     
    9494   Bit8u  LinRsvdFieldPosition;
    9595   Bit32u MaxPixelClock;
    96 //   Bit8u  Reserved[189]; // DO NOT PUT THIS IN HERE because of Compact Mode Info storage in bios 
     96//   Bit8u  Reserved[189]; // DO NOT PUT THIS IN HERE because of Compact Mode Info storage in bios
    9797} ModeInfoBlockCompact;
    9898
     
    277277  #define VBE_DISPI_BANK_ADDRESS          0xA0000
    278278  #define VBE_DISPI_BANK_SIZE_KB          64
    279  
     279
    280280  #define VBE_DISPI_MAX_XRES              1024
    281281  #define VBE_DISPI_MAX_YRES              768
    282  
     282
    283283  #define VBE_DISPI_IOPORT_INDEX          0x01CE
    284284  #define VBE_DISPI_IOPORT_DATA           0x01CF
    285  
     285
    286286  #define VBE_DISPI_INDEX_ID              0x0
    287287  #define VBE_DISPI_INDEX_XRES            0x1
     
    294294  #define VBE_DISPI_INDEX_X_OFFSET        0x8
    295295  #define VBE_DISPI_INDEX_Y_OFFSET        0x9
    296      
     296
    297297  #define VBE_DISPI_ID0                   0xB0C0
    298298  #define VBE_DISPI_ID1                   0xB0C1
     
    307307  #define VBE_DISPI_LFB_ENABLED           0x40
    308308  #define VBE_DISPI_NOCLEARMEM            0x80
    309  
     309
    310310  #define VBE_DISPI_LFB_PHYSICAL_ADDRESS  0xE0000000
    311311
     
    325325   * @remark duplicated in DevVGA.h. */
    326326  #define VBEHEADER_MAGIC      0x77CC
    327  
     327
    328328  /** The extra port which is used to read the mode list.
    329329   * @remark duplicated in DevVGA.h. */
  • trunk/src/VBox/Devices/Graphics/BIOS/vbetables-gen.c

    r6061 r26495  
    8080    pages = vram_size / (pm->height * pitch);
    8181    if (pages > 0) {
    82       printf("{ 0x%04x, /* %dx%dx%d */\n", 
     82      printf("{ 0x%04x, /* %dx%dx%d */\n",
    8383             pm->mode, pm->width, pm->height, pm->depth);
    8484      if (pm->depth == 4)
    85         printf("{ /*Bit16u ModeAttributes*/ %s,\n", 
     85        printf("{ /*Bit16u ModeAttributes*/ %s,\n",
    8686               "VBE_MODE_ATTRIBUTE_SUPPORTED | "
    8787               "VBE_MODE_ATTRIBUTE_EXTENDED_INFORMATION_AVAILABLE | "
     
    9090               "VBE_MODE_ATTRIBUTE_GRAPHICS_MODE");
    9191      else
    92         printf("{ /*Bit16u ModeAttributes*/ %s,\n", 
     92        printf("{ /*Bit16u ModeAttributes*/ %s,\n",
    9393               "VBE_MODE_ATTRIBUTE_SUPPORTED | "
    9494               "VBE_MODE_ATTRIBUTE_EXTENDED_INFORMATION_AVAILABLE | "
     
    196196      }
    197197
    198       printf("/*Bit8u  RedMaskSize*/ %d,\n", r_size);               
    199       printf("/*Bit8u  RedFieldPosition*/ %d,\n", r_pos);         
    200       printf("/*Bit8u  GreenMaskSize*/ %d,\n", g_size);             
    201       printf("/*Bit8u  GreenFieldPosition*/ %d,\n", g_pos);       
    202       printf("/*Bit8u  BlueMaskSize*/ %d,\n", b_size);             
    203       printf("/*Bit8u  BlueFieldPosition*/ %d,\n", b_pos);         
    204       printf("/*Bit8u  RsvdMaskSize*/ %d,\n", a_size);             
    205       printf("/*Bit8u  RsvdFieldPosition*/ %d,\n", a_pos);         
     198      printf("/*Bit8u  RedMaskSize*/ %d,\n", r_size);
     199      printf("/*Bit8u  RedFieldPosition*/ %d,\n", r_pos);
     200      printf("/*Bit8u  GreenMaskSize*/ %d,\n", g_size);
     201      printf("/*Bit8u  GreenFieldPosition*/ %d,\n", g_pos);
     202      printf("/*Bit8u  BlueMaskSize*/ %d,\n", b_size);
     203      printf("/*Bit8u  BlueFieldPosition*/ %d,\n", b_pos);
     204      printf("/*Bit8u  RsvdMaskSize*/ %d,\n", a_size);
     205      printf("/*Bit8u  RsvdFieldPosition*/ %d,\n", a_pos);
    206206      if (pm->depth == 32)
    207207        printf("/*Bit8u  DirectColorModeInfo*/ %s,\n",
  • trunk/src/VBox/Devices/Graphics/BIOS/vgafonts.h

    r21131 r26495  
    33 * The package is (c) by Joseph Gil
    44 * The individual fonts are public domain
    5  */ 
     5 */
    66static Bit8u vgafont8[256*8]=
    77{
  • trunk/src/VBox/Devices/Graphics/BIOS/vgatables.h

    r5450 r26495  
    11/*
    22 *
    3  * BIOS Memory 
     3 * BIOS Memory
    44 *
    55 */
     
    127127/* convert index in vga_modes[] to index in video_param_table[] */
    128128static Bit8u line_to_vpti[MODE_MAX+1]={
    129     0x17, 0x17, 0x18, 0x18, 0x04, 0x05, 0x06, 0x07, 
     129    0x17, 0x17, 0x18, 0x18, 0x04, 0x05, 0x06, 0x07,
    130130    0x0d, 0x0e, 0x11, 0x12, 0x1a, 0x1b, 0x1c, 0x1d,
    131131};
     
    539539  0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
    540540  0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
    541   0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f 
     541  0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f
    542542};
    543543
     
    551551  0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
    552552  0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
    553   0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f 
     553  0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f
    554554};
    555555
     
    563563  0x15,0x00,0x15, 0x15,0x00,0x3f, 0x15,0x2a,0x15, 0x15,0x2a,0x3f, 0x3f,0x00,0x15, 0x3f,0x00,0x3f, 0x3f,0x2a,0x15, 0x3f,0x2a,0x3f,
    564564  0x15,0x15,0x00, 0x15,0x15,0x2a, 0x15,0x3f,0x00, 0x15,0x3f,0x2a, 0x3f,0x15,0x00, 0x3f,0x15,0x2a, 0x3f,0x3f,0x00, 0x3f,0x3f,0x2a,
    565   0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f 
     565  0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f
    566566};
    567567
  • trunk/src/VBox/Devices/Input/UsbKbd.cpp

    r26473 r26495  
    243243
    244244/* Additional HID class interface descriptor. */
    245 static const uint8_t g_UsbHidIfHidDesc[] = 
     245static const uint8_t g_UsbHidIfHidDesc[] =
    246246{
    247247    /* .bLength = */                0x09,
     
    552552{
    553553    if (val > 127) {
    554         val = 127; 
     554        val = 127;
    555555    } else if (val < -127) {
    556556        val = -127;
     
    601601    fKeyDown = !(u8KeyCode & 0x80);
    602602
    603     if (fKeyDown) 
     603    if (fKeyDown)
    604604    {
    605605        for (i = 0; i < RT_ELEMENTS(pReport->aKeys); ++i)
     
    837837                }
    838838                break;
    839             }   
     839            }
    840840            case HID_REQ_GET_IDLE:
    841841            {
     
    851851                }
    852852                break;
    853             }   
     853            }
    854854        }
    855855        Log(("usbHid: Unimplemented class request: bmRequestType=%#x bRequest=%#x wValue=%#x wIndex=%#x wLength=%#x\n",
  • trunk/src/VBox/Devices/Input/UsbMouse.cpp

    r26473 r26495  
    240240
    241241/* Additional HID class interface descriptor. */
    242 static const uint8_t g_UsbHidIfHidDesc[] = 
     242static const uint8_t g_UsbHidIfHidDesc[] =
    243243{
    244244    /* .bLength = */                0x09,
     
    534534{
    535535    if (val > 127) {
    536         val = 127; 
     536        val = 127;
    537537    } else if (val < -127) {
    538538        val = -127;
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r26423 r26495  
    407407
    408408    /* @todo: Here we should get mbuf instead temporal buffer */
    409 #ifndef VBOX_WITH_SLIRP_BSD_MBUF 
     409#ifndef VBOX_WITH_SLIRP_BSD_MBUF
    410410    void *pvmBuf = slirp_ext_m_get(pThis->pNATState);
    411411    Assert(pvmBuf);
  • trunk/src/VBox/Devices/Network/slirp/bootp.c

    r26037 r26495  
    664664
    665665        case DHCPRELEASE:
    666             rc = dhcp_decode_release(pData, bp, buf, size); 
     666            rc = dhcp_decode_release(pData, bp, buf, size);
    667667            /* no reply required */
    668668            break;
  • trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.c

    r26404 r26495  
    102102#else /* VBOX */
    103103static void
    104 timeout(PNATState pData, struct socket *so, void *arg) 
     104timeout(PNATState pData, struct socket *so, void *arg)
    105105{
    106106    struct request *req = (struct request *)arg;
     
    119119        struct udphdr *udp;
    120120        int iphlen;
    121         struct socket *so1 = socreate(); 
     121        struct socket *so1 = socreate();
    122122        struct mbuf *m = NULL;
    123123        char *data;
     
    146146        /* mbuf initialization */
    147147        m->m_data += if_maxlinkhdr;
    148         ip = mtod(m, struct ip *); 
     148        ip = mtod(m, struct ip *);
    149149        udp = (struct udphdr *)&ip[1]; /* ip attributes */
    150150        data = (char *)&udp[1];
     
    175175 * queue and send it to the correct server.
    176176 *
    177  * Slirp: this routine should be called from udp_input 
     177 * Slirp: this routine should be called from udp_input
    178178 * socket is Slirp's construction (here we should set expiration time for socket)
    179179 * mbuf points on ip header to easy fetch information about source and destination.
     
    268268
    269269    /* fill the request structure */
    270     if (so->so_timeout_arg == NULL) 
     270    if (so->so_timeout_arg == NULL)
    271271    {
    272272        req->id = QUERYID;
     
    280280            if (fail_counter == 0)
    281281                LogRel(("NAT/dnsproxy: Empty DNS entry (suppressed 100 times)\n"));
    282             else 
     282            else
    283283                fail_counter = (fail_counter == 100 ? 0 : fail_counter + 1);
    284284            return;
    285            
     285
    286286        }
    287287        retransmit = 0;
     
    290290        req->nbyte = byte;
    291291        memcpy(req->byte, buf, byte); /* copying original request */
    292     } 
    293     else 
     292    }
     293    else
    294294    {
    295295        retransmit = 1;
     
    383383 * server. Find the corresponding query and send answer back to querying
    384384 * host.
    385  * 
     385 *
    386386 * Slirp: we call this from the routine from socrecvfrom routine handling UDP responses.
    387387 * So at the moment of call response already has been readed and packed into the mbuf
     
    430430    if ((query = hash_find_request(pData, *((unsigned short *)buf))) == NULL) {
    431431        ++late_answers;
    432         /* Probably, this request wasn't serviced by 
     432        /* Probably, this request wasn't serviced by
    433433         * dnsproxy so we won't care about it here*/
    434434        so->so_expire = curtime + SO_EXPIREFAST;
     
    632632}
    633633#else
    634 int 
     634int
    635635dnsproxy_init(PNATState pData)
    636636{
  • trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.h

    r18815 r26495  
    7878    struct request      *next;
    7979#ifdef VBOX
    80     /* this field used for saving last attempt 
    81      * to connect server, timeout function should change 
     80    /* this field used for saving last attempt
     81     * to connect server, timeout function should change
    8282     * it's value on next server. And dnsproxy_query should
    8383     * initializate with first server in the list
    8484     */
    85     struct dns_entry    *dns_server;   
     85    struct dns_entry    *dns_server;
    8686    int nbyte; /* length of dns request */
    8787    char byte[1]; /* copy of original request */
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias.c

    r23154 r26495  
    759759        ad.dport = &ud->uh_dport;
    760760        ad.maxpktsize = 0;
    761        
     761
    762762
    763763        alias_address = GetAliasAddress(lnk);
     
    766766        ud->uh_dport = GetOriginalPort(lnk);
    767767
    768         /* Walk out chain. */       
     768        /* Walk out chain. */
    769769        error = find_handler(IN, UDP, la, pip, &ad);
    770770
     
    815815        struct in_addr alias_address;
    816816        struct alias_data ad;
    817         ad.lnk = lnk; 
     817        ad.lnk = lnk;
    818818        ad.oaddr = NULL;
    819819        ad.aaddr = &alias_address;
     
    826826        alias_port = GetAliasPort(lnk);
    827827
    828         /* Walk out chain. */       
     828        /* Walk out chain. */
    829829        error = find_handler(OUT, UDP, la, pip, &ad);
    830830
     
    876876        int accumulate, error;
    877877
    878         /* 
    879          * The init of MANY vars is a bit below, but aliashandlepptpin 
     878        /*
     879         * The init of MANY vars is a bit below, but aliashandlepptpin
    880880         * seems to need the destination port that came within the
    881881         * packet and not the original one looks below [*].
     
    883883
    884884        struct alias_data ad;
    885         ad.lnk = lnk; 
     885        ad.lnk = lnk;
    886886        ad.oaddr = NULL;
    887887        ad.aaddr = NULL;
     
    891891        ad.maxpktsize = 0;
    892892
    893         /* Walk out chain. */       
     893        /* Walk out chain. */
    894894        error = find_handler(IN, TCP, la, pip, &ad);
    895895
     
    901901        proxy_port = GetProxyPort(lnk);
    902902
    903         /* 
    904          * Look above, if anyone is going to add find_handler AFTER 
     903        /*
     904         * Look above, if anyone is going to add find_handler AFTER
    905905         * this aliashandlepptpin/point, please redo alias_data too.
    906906         * Uncommenting the piece here below should be enough.
     
    916916                    .maxpktsize = 0
    917917                };
    918        
     918
    919919                /* Walk out chain. */
    920920                error = find_handler(la, pip, &ad);
     
    10261026        int accumulate;
    10271027        struct alias_data ad;
    1028         ad.lnk = lnk; 
     1028        ad.lnk = lnk;
    10291029        ad.oaddr = NULL;
    10301030        ad.aaddr = &alias_address;
     
    10491049/* Monitor TCP connection state */
    10501050        TcpMonitorOut(pip, lnk);
    1051        
    1052         /* Walk out chain. */       
     1051
     1052        /* Walk out chain. */
    10531053        error = find_handler(OUT, TCP, la, pip, &ad);
    10541054
     
    11931193        SetFragmentPtr(lnk, NULL);
    11941194        SetExpire(lnk, 0);  /* Deletes link */
    1195     } else     
     1195    } else
    11961196        fptr = NULL;
    11971197
     
    12631263    if (ntohs(pip->ip_len) > maxpacketsize
    12641264        || (pip->ip_hl << 2) > maxpacketsize) {
    1265         iresult = PKT_ALIAS_IGNORED; 
     1265        iresult = PKT_ALIAS_IGNORED;
    12661266        goto getout;
    12671267    }
     
    12831283            int error;
    12841284            struct alias_data ad;
    1285             ad.lnk = NULL, 
    1286             ad.oaddr = NULL, 
     1285            ad.lnk = NULL,
     1286            ad.oaddr = NULL,
    12871287            ad.aaddr = NULL,
    12881288            ad.aport = NULL,
    12891289            ad.sport = NULL,
    12901290            ad.dport = NULL,
    1291             ad.maxpktsize = 0                 
    1292            
    1293             /* Walk out chain. */       
     1291            ad.maxpktsize = 0
     1292
     1293            /* Walk out chain. */
    12941294            error = find_handler(IN, IP, la, pip, &ad);
    12951295            if (error ==  0)
     
    12981298                iresult = ProtoAliasIn(la, pip);
    12991299        }
    1300             break; 
     1300            break;
    13011301#endif
    13021302        default:
     
    14261426            int error;
    14271427            struct alias_data ad = {
    1428                 .lnk = NULL, 
    1429                 .oaddr = NULL, 
     1428                .lnk = NULL,
     1429                .oaddr = NULL,
    14301430                .aaddr = NULL,
    14311431                .aport = NULL,
    14321432                .sport = NULL,
    14331433                .dport = NULL,
    1434                 .maxpktsize = 0                 
     1434                .maxpktsize = 0
    14351435            };
    1436             /* Walk out chain. */       
     1436            /* Walk out chain. */
    14371437            error = find_handler(OUT, IP, la, pip, &ad);
    14381438            if (error == 0)
     
    15831583    for (;;) {
    15841584        fgets(buf, 256, fd);
    1585         if feof(fd) 
     1585        if feof(fd)
    15861586                break;
    15871587        len = strlen(buf);
     
    16531653
    16541654    /* Unload all modules then reload everything. */
    1655     while ((p = first_handler()) != NULL) { 
     1655    while ((p = first_handler()) != NULL) {
    16561656        detach_handler(p);
    16571657    }
    1658     while ((t = walk_dll_chain()) != NULL) {   
     1658    while ((t = walk_dll_chain()) != NULL) {
    16591659        dlclose(t->handle);
    16601660        free(t);
     
    16811681struct mbuf *
    16821682#ifndef VBOX
    1683 m_megapullup(struct mbuf *m, int len) 
     1683m_megapullup(struct mbuf *m, int len)
    16841684#else
    16851685m_megapullup(PNATState pData, struct mbuf *m, int len)
     
    16871687{
    16881688    struct mbuf *mcl;
    1689    
     1689
    16901690    if (len > m->m_pkthdr.len)
    16911691        goto bad;
    1692    
     1692
    16931693    /* Do not reallocate packet if it is sequentional,
    16941694     * writable and has some extra space for expansion.
     
    17231723    if (mcl == NULL)
    17241724        goto bad;
    1725  
     1725
    17261726    m_move_pkthdr(mcl, m);
    17271727    m_copydata(m, 0, len, mtod(mcl, caddr_t));
     
    17321732    m_freem(pData, m);
    17331733#endif
    1734  
     1734
    17351735    return (mcl);
    17361736bad:
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias.h

    r23154 r26495  
    7777 */
    7878struct libalias;
    79 #if defined(VBOX) && !defined(VBOX_SLIRP_ALIAS) 
     79#if defined(VBOX) && !defined(VBOX_SLIRP_ALIAS)
    8080/* XXX: used only for browsing */
    8181struct libalias {
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_cuseeme.c

    r20958 r26495  
    5757
    5858static void
    59 AliasHandleCUSeeMeOut(struct libalias *la, struct ip *pip, 
     59AliasHandleCUSeeMeOut(struct libalias *la, struct ip *pip,
    6060              struct alias_link *lnk);
    6161
    6262static void
    63 AliasHandleCUSeeMeIn(struct libalias *la, struct ip *pip, 
     63AliasHandleCUSeeMeIn(struct libalias *la, struct ip *pip,
    6464             struct in_addr original_addr);
    6565
    66 static int 
     66static int
    6767fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah)
    6868{
     
    7575}
    7676
    77 static int 
     77static int
    7878protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah)
    7979{
    80    
     80
    8181    AliasHandleCUSeeMeIn(la, pip, *ah->oaddr);
    8282    return (0);
    8383}
    8484
    85 static int 
     85static int
    8686protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah)
    8787{
    88    
     88
    8989    AliasHandleCUSeeMeOut(la, pip, ah->lnk);
    9090    return (0);
     
    9393/* Kernel module definition. */
    9494struct proto_handler handlers[] = {
    95     { 
    96       .pri = 120, 
    97       .dir = OUT, 
    98       .proto = UDP, 
    99       .fingerprint = &fingerprint, 
     95    {
     96      .pri = 120,
     97      .dir = OUT,
     98      .proto = UDP,
     99      .fingerprint = &fingerprint,
    100100      .protohandler = &protohandlerout
    101     }, 
     101    },
    102102    {
    103       .pri = 120, 
    104       .dir = IN, 
    105       .proto = UDP, 
    106       .fingerprint = &fingerprint, 
     103      .pri = 120,
     104      .dir = IN,
     105      .proto = UDP,
     106      .fingerprint = &fingerprint,
    107107      .protohandler = &protohandlerin
    108     }, 
     108    },
    109109    { EOH }
    110110};
     
    131131
    132132#ifdef _KERNEL
    133 static 
    134 #endif
    135 moduledata_t 
     133static
     134#endif
     135moduledata_t
    136136alias_mod = {
    137137       "alias_cuseeme", mod_handler, NULL
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_db.c

    r25364 r26495  
    157157#include <sys/errno.h>
    158158#include <sys/time.h>
    159 #include <unistd.h> 
     159#include <unistd.h>
    160160#endif
    161161
     
    163163#include <netinet/tcp.h>
    164164
    165 #ifdef _KERNEL 
     165#ifdef _KERNEL
    166166#include <netinet/libalias/alias.h>
    167167#include <netinet/libalias/alias_local.h>
     
    338338
    339339#ifndef NO_USE_SOCKETS
    340 # ifndef VBOX 
    341     /* 
    342      * in VBox we do not use host's sockets here, which are managed 
     340# ifndef VBOX
     341    /*
     342     * in VBox we do not use host's sockets here, which are managed
    343343     * inside slirp. yes we have to create new sockets here but latter
    344      * managment and deletion are in repsponsible of Slirp. 
     344     * managment and deletion are in repsponsible of Slirp.
    345345     */
    346346    int     sockfd; /* socket descriptor                   */
     
    486486static void
    487487AliasLog(char *str, const char *format, ...)
    488 {       
     488{
    489489    va_list ap;
    490    
     490
    491491    va_start(ap, format);
    492492    vsnprintf(str, LIBALIAS_BUF_SIZE, format, ap);
     
    499499# ifndef VBOX
    500500    va_list ap;
    501    
     501
    502502    va_start(ap, format);
    503503    vfprintf(stream, format, ap);
     
    525525/* Used for debugging */
    526526    if (la->logDesc) {
    527         int tot  = la->icmpLinkCount + la->udpLinkCount + 
     527        int tot  = la->icmpLinkCount + la->udpLinkCount +
    528528            la->tcpLinkCount + la->pptpLinkCount +
    529529            la->protoLinkCount + la->fragmentIdLinkCount +
    530530            la->fragmentPtrLinkCount;
    531        
     531
    532532        AliasLog(la->logDesc,
    533533             "icmp=%u, udp=%u, tcp=%u, pptp=%u, proto=%u, frag_id=%u frag_ptr=%u / tot=%u",
     
    540540             la->fragmentPtrLinkCount, tot);
    541541#ifndef _KERNEL
    542         AliasLog(la->logDesc, " (sock=%u)\n", la->sockCount); 
     542        AliasLog(la->logDesc, " (sock=%u)\n", la->sockCount);
    543543#endif
    544544    }
     
    781781#ifdef VBOX
    782782            so->so_expire = la->curtime + SO_EXPIRE;
    783             setsockopt(so->s, SOL_SOCKET, SO_BROADCAST, 
     783            setsockopt(so->s, SOL_SOCKET, SO_BROADCAST,
    784784                (const char *)&opt, sizeof(opt));
    785785            status = getsockname(so->s, &sa_addr, &socklen);
     
    791791            }
    792792            so->so_hlport = ((struct sockaddr_in *)&sa_addr)->sin_port;
    793             so->so_hladdr.s_addr = 
     793            so->so_hladdr.s_addr =
    794794                ((struct sockaddr_in *)&sa_addr)->sin_addr.s_addr;
    795795            NSOCK_INC_EX(la);
    796         if (link_type == LINK_TCP) 
     796        if (link_type == LINK_TCP)
    797797            {
    798798                insque(la->pData, so, &la->tcb);
    799799            }
    800         else if (link_type == LINK_UDP) 
     800        else if (link_type == LINK_UDP)
    801801            {
    802802                insque(la->pData, so, &la->udb);
    803803            }
    804             else {   
     804            else {
    805805                Assert(!"Shouldn't be here");
    806806            }
    807        
     807
    808808#else
    809809        *sockfd = sock;
     
    812812    } else {
    813813#ifdef VBOX
    814         if (sock >= 0) 
     814        if (sock >= 0)
    815815            closesocket(sock);
    816816        /* socket wasn't enqueued so we shouldn't use sofree */
     
    15281528    u_short ip_id)
    15291529{
    1530    
     1530
    15311531    LIBALIAS_LOCK_ASSERT(la);
    15321532    return FindLinkIn(la, dst_addr, alias_addr,
     
    20152015GetDefaultAliasAddress(struct libalias *la)
    20162016{
    2017    
     2017
    20182018    LIBALIAS_LOCK_ASSERT(la);
    20192019    return (la->aliasAddress);
     
    22402240ClearCheckNewLink(struct libalias *la)
    22412241{
    2242    
     2242
    22432243    LIBALIAS_LOCK_ASSERT(la);
    22442244    la->newDefaultLink = 0;
     
    23502350        if ((la->logDesc = malloc(LIBALIAS_BUF_SIZE)))
    23512351            ;
    2352 #else       
     2352#else
    23532353        if ((la->logDesc = fopen("/var/log/alias.log", "w")))
    2354             fprintf(la->logDesc, "PacketAlias/InitPacketAliasLog: Packet alias logging enabled.\n");           
    2355 #endif
    2356         else 
     2354            fprintf(la->logDesc, "PacketAlias/InitPacketAliasLog: Packet alias logging enabled.\n");
     2355#endif
     2356        else
    23572357            return (ENOMEM); /* log initialization failed */
    23582358#else
    2359         Log2(("NAT: PacketAlias/InitPacketAliasLog: Packet alias logging enabled.\n"));       
     2359        Log2(("NAT: PacketAlias/InitPacketAliasLog: Packet alias logging enabled.\n"));
    23602360        la->logDesc = (void *)1; /* XXX: in vbox we don't use this param */
    23612361#endif
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_dns.c

    r25353 r26495  
    7171static void QStr2CStr(const char *pcszQStr, char *pszStr, size_t cStr);
    7272
    73 static int 
     73static int
    7474fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah)
    7575{
     
    7878        return -1;
    7979
    80     fprintf(stderr, "NAT:%s: ah(dport: %hd, sport: %hd) oaddr:%R[IP4] aaddr:%R[IP4]\n", 
     80    fprintf(stderr, "NAT:%s: ah(dport: %hd, sport: %hd) oaddr:%R[IP4] aaddr:%R[IP4]\n",
    8181        __FUNCTION__, ntohs(*ah->dport), ntohs(*ah->sport),
    8282        &ah->oaddr, &ah->aaddr);
     
    100100        hdr->X.rd = 1;
    101101        hdr->X.rcode = 3;
    102     } 
     102    }
    103103    else
    104104    {
     
    110110        uint16_t packet_len = 0;
    111111        uint16_t addr_off = (uint16_t)~0;
    112        
     112
    113113#if 0
    114114        /* here is no compressed names+answers + new query */
     
    117117        packet_len = (pip->ip_hl << 2)
    118118                   + sizeof(struct udphdr)
    119                    + sizeof(union dnsmsg_header) 
     119                   + sizeof(union dnsmsg_header)
    120120                   + strlen(qname)
    121121                   + 2 * sizeof(uint16_t); /* ip + udp + header + query */
     
    159159        {
    160160            struct dnsmsg_answer *ans = (struct dnsmsg_answer *)answers;
    161            
     161
    162162            ans->name = htons(off);
    163163            ans->type = htons(1);
     
    180180    }
    181181}
    182 static int 
     182static int
    183183protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
    184184{
     
    206206        qw_qtype = (uint16_t *)(qw_qname + strlen(qw_qname) + 1);
    207207        qw_qclass = &qw_qtype[1];
    208         fprintf(stderr, "qname:%s qtype:%hd qclass:%hd\n", 
     208        fprintf(stderr, "qname:%s qtype:%hd qclass:%hd\n",
    209209            qw_qname, ntohs(*qw_qtype), ntohs(*qw_qclass));
    210210    }
     
    215215    doanswer(la, hdr, qw_qname, pip, h);
    216216
    217     /* 
     217    /*
    218218     * We have changed the size and the content of udp, to avoid double csum calculation
    219219     * will assign to zero
     
    245245            || *q == '_')
    246246        {
    247            *c = *q; 
     247           *c = *q;
    248248            c++;
    249249        }
     
    271271    {
    272272        /* at the begining or at -dot- position */
    273         if (*c == '.' || (c == pcszStr && q == pszQStr)) 
     273        if (*c == '.' || (c == pcszStr && q == pszQStr))
    274274        {
    275275            if (c != pcszStr)
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_dummy.c

    r20958 r26495  
    2828__FBSDID("$FreeBSD: src/sys/netinet/libalias/alias_dummy.c,v 1.1.8.1 2009/04/15 03:14:26 kensmith Exp $");
    2929
    30 /* 
     30/*
    3131 * Alias_dummy is just an empty skeleton used to demostrate how to write
    3232 * a module for libalias, that will run unalterated in userland or in
     
    6060AliasHandleDummy(struct libalias *la, struct ip *ip, struct alias_data *ah);
    6161
    62 static int 
     62static int
    6363fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah)
    6464{
    6565
    66     /* 
    67      * Check here all the data that will be used later, if any field 
     66    /*
     67     * Check here all the data that will be used later, if any field
    6868     * is empy/NULL, return a -1 value.
    6969     */
    70     if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 
     70    if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL ||
    7171        ah->maxpktsize == 0)
    7272        return (-1);
    73     /* 
    74      * Fingerprint the incoming packet, if it matches any conditions 
     73    /*
     74     * Fingerprint the incoming packet, if it matches any conditions
    7575     * return an OK value.
    7676     */
     
    8181}
    8282
    83 /* 
    84  * Wrap in this general purpose function, the real function used to alias the 
     83/*
     84 * Wrap in this general purpose function, the real function used to alias the
    8585 * packets.
    8686 */
    8787
    88 static int 
     88static int
    8989protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
    9090{
    91    
     91
    9292    AliasHandleDummy(la, pip, ah);
    9393    return (0);
    9494}
    9595
    96 /* 
    97  * NOTA BENE: the next variable MUST NOT be renamed in any case if you want 
    98  * your module to work in userland, cause it's used to find and use all 
     96/*
     97 * NOTA BENE: the next variable MUST NOT be renamed in any case if you want
     98 * your module to work in userland, cause it's used to find and use all
    9999 * the protocol handlers present in every module.
    100  * So WATCH OUT, your module needs this variables and it needs it with 
     100 * So WATCH OUT, your module needs this variables and it needs it with
    101101 * ITS EXACT NAME: handlers.
    102102 */
    103103
    104104struct proto_handler handlers [] = {
    105     { 
    106       .pri = 666, 
    107       .dir = IN|OUT, 
    108       .proto = UDP|TCP, 
    109       .fingerprint = &fingerprint, 
     105    {
     106      .pri = 666,
     107      .dir = IN|OUT,
     108      .proto = UDP|TCP,
     109      .fingerprint = &fingerprint,
    110110      .protohandler = &protohandler
    111     }, 
     111    },
    112112    { EOH }
    113113};
     
    118118    int error;
    119119
    120     switch (type) {   
     120    switch (type) {
    121121    case MOD_LOAD:
    122122        error = 0;
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_ftp.c

    r24233 r26495  
    109109
    110110static void
    111 AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *, 
     111AliasHandleFtpOut(struct libalias *, struct ip *, struct alias_link *,
    112112          int maxpacketsize);
    113113
    114 static int 
     114static int
    115115fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah)
    116116{
    117117
    118     if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 
     118    if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL ||
    119119        ah->maxpktsize == 0)
    120120        return (-1);
     
    125125}
    126126
    127 static int 
     127static int
    128128protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
    129129{
    130    
     130
    131131    AliasHandleFtpOut(la, pip, ah->lnk, ah->maxpktsize);
    132132    return (0);
     
    135135#ifndef VBOX
    136136struct proto_handler handlers[] = {
    137     { 
    138       .pri = 80, 
    139       .dir = OUT, 
    140       .proto = TCP, 
    141       .fingerprint = &fingerprint, 
     137    {
     138      .pri = 80,
     139      .dir = OUT,
     140      .proto = TCP,
     141      .fingerprint = &fingerprint,
    142142      .protohandler = &protohandler
    143     }, 
     143    },
    144144    { EOH }
    145145};
     
    181181#endif /* VBOX */
    182182
    183     switch (type) {   
     183    switch (type) {
    184184    case MOD_LOAD:
    185185        error = 0;
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_irc.c

    r20958 r26495  
    8989
    9090static void
    91 AliasHandleIrcOut(struct libalias *, struct ip *, struct alias_link *, 
     91AliasHandleIrcOut(struct libalias *, struct ip *, struct alias_link *,
    9292          int maxpacketsize);
    9393
    94 static int 
     94static int
    9595fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah)
    9696{
    9797
    98     if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL || 
     98    if (ah->dport == NULL || ah->dport == NULL || ah->lnk == NULL ||
    9999        ah->maxpktsize == 0)
    100100        return (-1);
     
    105105}
    106106
    107 static int 
     107static int
    108108protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
    109109{
     
    118118
    119119struct proto_handler handlers[] = {
    120     { 
    121       .pri = 90, 
    122       .dir = OUT, 
    123       .proto = TCP, 
    124       .fingerprint = &fingerprint, 
     120    {
     121      .pri = 90,
     122      .dir = OUT,
     123      .proto = TCP,
     124      .fingerprint = &fingerprint,
    125125      .protohandler = &protohandler
    126     }, 
     126    },
    127127    { EOH }
    128128};
     
    149149
    150150#ifdef _KERNEL
    151 static 
     151static
    152152#endif
    153153moduledata_t alias_mod = {
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_local.h

    r21671 r26495  
    121121    int     deleteAllLinks; /* If equal to zero, DeleteLink()  */
    122122    /* will not remove permanent links */
    123    
    124     /* log descriptor        */ 
     123
     124    /* log descriptor        */
    125125#ifdef  _KERNEL
    126     char           *logDesc;       
    127 #else 
    128     FILE           *logDesc;   
     126    char           *logDesc;
     127#else
     128    FILE           *logDesc;
    129129#endif
    130130    /* statistics monitoring */
     
    157157    u_short     true_port;  /* in host byte order. */
    158158#if defined(_KERNEL) && !defined(VBOX)
    159     /* 
     159    /*
    160160     * avoid races in libalias: every public function has to use it.
    161161     */
     
    178178#else
    179179#define LIBALIAS_LOCK_INIT(l)
    180 #define LIBALIAS_LOCK_ASSERT(l) 
     180#define LIBALIAS_LOCK_ASSERT(l)
    181181#define LIBALIAS_LOCK(l)
    182182#define LIBALIAS_UNLOCK(l)
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_mod.c

    r21864 r26495  
    6363struct rwlock   handler_rw;
    6464#endif
    65 SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(foo); 
     65SLIST_HEAD(dll_chain, dll) dll_chain = SLIST_HEAD_INITIALIZER(foo);
    6666
    6767#ifdef _KERNEL
     
    123123#define _handler_chain_init() ;
    124124#define _handler_chain_destroy() ;
    125 #endif 
     125#endif
    126126
    127127void
     
    146146    struct proto_handler *b = NULL;
    147147
    148     LIBALIAS_WLOCK_ASSERT();   
     148    LIBALIAS_WLOCK_ASSERT();
    149149    LIST_FOREACH(b, &handler_chain, entries) {
    150         if ((b->pri == p->pri) && 
     150        if ((b->pri == p->pri) &&
    151151            (b->dir == p->dir) &&
    152152            (b->proto == p->proto))
     
    174174    struct proto_handler *b, *b_tmp;;
    175175
    176     LIBALIAS_WLOCK_ASSERT();   
     176    LIBALIAS_WLOCK_ASSERT();
    177177    LIST_FOREACH_SAFE(b, &handler_chain, entries, b_tmp) {
    178178        if (b == p) {
     
    195195    LIBALIAS_WLOCK();
    196196    for (i=0; 1; i++) {
    197         if (*((int *)&_p[i]) == EOH) 
     197        if (*((int *)&_p[i]) == EOH)
    198198            break;
    199199#ifdef VBOX
     
    202202        error = _attach_handler(&_p[i]);
    203203#endif
    204         if (error != 0) 
     204        if (error != 0)
    205205            break;
    206206    }
     
    220220    LIBALIAS_WLOCK();
    221221    for (i=0; 1; i++) {
    222         if (*((int *)&_p[i]) == EOH) 
     222        if (*((int *)&_p[i]) == EOH)
    223223            break;
    224224#ifdef VBOX
     
    227227        error = _detach_handler(&_p[i]);
    228228#endif
    229         if (error != 0) 
     229        if (error != 0)
    230230            break;
    231231    }
     
    254254
    255255int
    256 find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip, 
     256find_handler(int8_t dir, int8_t proto, struct libalias *la, struct ip *pip,
    257257         struct alias_data *ad)
    258258{
     
    264264
    265265    LIBALIAS_RLOCK();
    266    
     266
    267267    LIST_FOREACH(p, &handler_chain, entries) {
    268268        if ((p->dir & dir) && (p->proto & proto))
     
    273273    }
    274274    LIBALIAS_RUNLOCK();
    275     return (error); 
     275    return (error);
    276276}
    277277
     
    283283#endif
    284284{
    285    
    286     return (LIST_FIRST(&handler_chain));   
     285
     286    return (LIST_FIRST(&handler_chain));
    287287}
    288288
     
    310310    SLIST_FOREACH_SAFE(b, &dll_chain, next, b_tmp)
    311311        if (!strncmp(b->name, p, DLL_LEN)) {
    312             SLIST_REMOVE(&dll_chain, b, dll, next); 
     312            SLIST_REMOVE(&dll_chain, b, dll, next);
    313313            error = b;
    314314            break;
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_mod.h

    r21864 r26495  
    5454
    5555/* Packet flow direction. */
    56 #define IN                              1 
    57 #define OUT                             2 
     56#define IN                              1
     57#define OUT                             2
    5858
    5959/* Working protocol. */
     
    6262#define UDP                             4
    6363
    64 /* 
     64/*
    6565 * Data passed to protocol handler module, it must be filled
    6666 * right before calling find_handler() to determine which
     
    6868 */
    6969
    70 struct alias_data { 
    71     struct alias_link       *lnk;           
     70struct alias_data {
     71    struct alias_link       *lnk;
    7272    struct in_addr          *oaddr;         /* Original address. */
    73     struct in_addr          *aaddr;         /* Alias address. */ 
     73    struct in_addr          *aaddr;         /* Alias address. */
    7474    uint16_t                *aport;         /* Alias port. */
    7575    uint16_t                *sport, *dport; /* Source & destination port */
    7676    uint16_t                maxpktsize;     /* Max packet size. */
    77 }; 
     77};
    7878
    79 /* 
     79/*
    8080 * This structure contains all the information necessary to make
    8181 * a protocol handler correctly work.
     
    8585    u_int pri;                                              /* Handler priority. */
    8686        int16_t dir;                                            /* Flow direction. */
    87     uint8_t proto;                                          /* Working protocol. */ 
     87    uint8_t proto;                                          /* Working protocol. */
    8888    int (*fingerprint)(struct libalias *la,                 /* Fingerprint * function. */
    8989         struct ip *pip, struct alias_data *ah);
    9090    int (*protohandler)(struct libalias *la,                /* Aliasing * function. */
    91          struct ip *pip, struct alias_data *ah);                 
     91         struct ip *pip, struct alias_data *ah);
    9292    LIST_ENTRY(proto_handler) entries;
    9393};
    9494
    9595
    96 /* 
     96/*
    9797 * Used only in userland when libalias needs to keep track of all
    9898 * module loaded. In kernel land (kld mode) we don't need to care
     
    101101
    102102#define DLL_LEN         32
    103 struct dll {   
     103struct dll {
    104104    char            name[DLL_LEN];  /* Name of module. */
    105     void            *handle;        /* 
     105    void            *handle;        /*
    106106                     * Ptr to shared obj obtained through
    107107                     * dlopen() - use this ptr to get access
    108                      * to any symbols from a loaded module                   
    109                      * via dlsym(). 
     108                     * to any symbols from a loaded module
     109                     * via dlsym().
    110110                     */
    111111    SLIST_ENTRY(dll)        next;
     
    127127struct proto_handler *first_handler(void);
    128128#endif
    129 int             find_handler(int8_t, int8_t, struct libalias *, 
     129int             find_handler(int8_t, int8_t, struct libalias *,
    130130                             struct ip *, struct alias_data *);
    131131
     
    141141#define EOH     -1
    142142
    143 /* 
     143/*
    144144 * Some defines borrowed from sys/module.h used to compile a kld
    145145 * in userland as a shared lib.
     
    153153        MOD_QUIESCE
    154154} modeventtype_t;
    155        
     155
    156156typedef struct module *module_t;
    157157typedef int (*modeventhand_t)(module_t, int /* modeventtype_t */, void *);
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_pptp.c

    r20958 r26495  
    7979AliasHandlePptpGreIn(struct libalias *, struct ip *);
    8080
    81 static int 
     81static int
    8282fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah)
    8383{
     
    9191}
    9292
    93 static int 
     93static int
    9494fingerprintgre(struct libalias *la, struct ip *pip, struct alias_data *ah)
    9595{
     
    9898}
    9999
    100 static int 
     100static int
    101101protohandlerin(struct libalias *la, struct ip *pip, struct alias_data *ah)
    102102{
    103    
     103
    104104    AliasHandlePptpIn(la, pip, ah->lnk);
    105105    return (0);
    106106}
    107107
    108 static int 
     108static int
    109109protohandlerout(struct libalias *la, struct ip *pip, struct alias_data *ah)
    110110{
    111    
     111
    112112    AliasHandlePptpOut(la, pip, ah->lnk);
    113113    return (0);
    114114}
    115115
    116 static int 
     116static int
    117117protohandlergrein(struct libalias *la, struct ip *pip, struct alias_data *ah)
    118118{
     
    124124}
    125125
    126 static int 
     126static int
    127127protohandlergreout(struct libalias *la, struct ip *pip, struct alias_data *ah)
    128128{
     
    135135/* Kernel module definition. */
    136136struct proto_handler handlers[] = {
    137     { 
    138       .pri = 200, 
    139       .dir = IN, 
    140       .proto = TCP, 
    141       .fingerprint = &fingerprint, 
     137    {
     138      .pri = 200,
     139      .dir = IN,
     140      .proto = TCP,
     141      .fingerprint = &fingerprint,
    142142      .protohandler = &protohandlerin
    143143    },
    144     { 
    145       .pri = 210, 
    146       .dir = OUT, 
    147       .proto = TCP, 
    148       .fingerprint = &fingerprint, 
     144    {
     145      .pri = 210,
     146      .dir = OUT,
     147      .proto = TCP,
     148      .fingerprint = &fingerprint,
    149149      .protohandler = &protohandlerout
    150150    },
    151 /* 
    152  * WATCH OUT!!! these 2 handlers NEED a priority of INT_MAX (highest possible) 
     151/*
     152 * WATCH OUT!!! these 2 handlers NEED a priority of INT_MAX (highest possible)
    153153 * cause they will ALWAYS process packets, so they must be the last one
    154154 * in chain: look fingerprintgre() above.
    155155 */
    156     { 
    157       .pri = INT_MAX, 
    158       .dir = IN, 
    159       .proto = IP, 
    160       .fingerprint = &fingerprintgre, 
     156    {
     157      .pri = INT_MAX,
     158      .dir = IN,
     159      .proto = IP,
     160      .fingerprint = &fingerprintgre,
    161161      .protohandler = &protohandlergrein
    162162    },
    163     { 
    164       .pri = INT_MAX, 
    165       .dir = OUT, 
    166       .proto = IP, 
    167       .fingerprint = &fingerprintgre, 
     163    {
     164      .pri = INT_MAX,
     165      .dir = OUT,
     166      .proto = IP,
     167      .fingerprint = &fingerprintgre,
    168168      .protohandler = &protohandlergreout
    169     }, 
     169    },
    170170    { EOH }
    171171};
     
    191191
    192192#ifdef _KERNEL
    193 static 
     193static
    194194#endif
    195195moduledata_t alias_mod = {
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_skinny.c

    r20958 r26495  
    5757AliasHandleSkinny(struct libalias *, struct ip *, struct alias_link *);
    5858
    59 static int 
     59static int
    6060fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah)
    6161{
     
    6969}
    7070
    71 static int 
     71static int
    7272protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
    7373{
    74    
     74
    7575        AliasHandleSkinny(la, pip, ah->lnk);
    7676    return (0);
     
    7878
    7979struct proto_handler handlers[] = {
    80     { 
    81       .pri = 110, 
    82       .dir = IN|OUT, 
    83       .proto = TCP, 
    84       .fingerprint = &fingerprint, 
     80    {
     81      .pri = 110,
     82      .dir = IN|OUT,
     83      .proto = TCP,
     84      .fingerprint = &fingerprint,
    8585      .protohandler = &protohandler
    86     }, 
     86    },
    8787    { EOH }
    8888};
     
    109109
    110110#ifdef _KERNEL
    111 static 
     111static
    112112#endif
    113113moduledata_t alias_mod = {
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_smedia.c

    r20958 r26495  
    130130
    131131static void
    132 AliasHandleRtspOut(struct libalias *, struct ip *, struct alias_link *, 
     132AliasHandleRtspOut(struct libalias *, struct ip *, struct alias_link *,
    133133          int maxpacketsize);
    134 static int 
     134static int
    135135fingerprint(struct libalias *la, struct ip *pip, struct alias_data *ah)
    136136{
     
    139139            ntohs(*ah->dport) == TFTP_PORT_NUMBER)
    140140        return (0);
    141     if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 
     141    if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL ||
    142142        ah->maxpktsize == 0)
    143143        return (-1);
     
    150150}
    151151
    152 static int 
     152static int
    153153protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
    154154{
    155    
     155
    156156    if (ntohs(*ah->dport) == TFTP_PORT_NUMBER)
    157157        FindRtspOut(la, pip->ip_src, pip->ip_dst,
    158158                *ah->sport, *ah->aport, IPPROTO_UDP);
    159     else AliasHandleRtspOut(la, pip, ah->lnk, ah->maxpktsize); 
     159    else AliasHandleRtspOut(la, pip, ah->lnk, ah->maxpktsize);
    160160    return (0);
    161161}
    162162
    163163struct proto_handler handlers[] = {
    164     { 
    165       .pri = 100, 
    166       .dir = OUT, 
     164    {
     165      .pri = 100,
     166      .dir = OUT,
    167167      .proto = TCP|UDP,
    168       .fingerprint = &fingerprint, 
     168      .fingerprint = &fingerprint,
    169169      .protohandler = &protohandler
    170     }, 
     170    },
    171171    { EOH }
    172172};
     
    193193
    194194#ifdef _KERNEL
    195 static 
     195static
    196196#endif
    197197moduledata_t alias_mod = {
  • trunk/src/VBox/Devices/Network/slirp/mbuf.c

    r26423 r26495  
    2323    int i;
    2424    struct mbuf *m;
    25     uint8_t *zone = RTMemAlloc(msize * MBUF_ZONE_SIZE); 
     25    uint8_t *zone = RTMemAlloc(msize * MBUF_ZONE_SIZE);
    2626    if (zone == NULL)
    2727    {
     
    5151    pData->mbuf_water_line_limit = pData->mbuf_zone_count * MBUF_ZONE_SIZE;
    5252    return 0;
    53 } 
     53}
    5454
    5555void m_fini(PNATState pData)
     
    6666        {
    6767            m = (struct mbuf *)((char *)zone + i*msize);
    68             if (   (m->m_flags & M_EXT) 
     68            if (   (m->m_flags & M_EXT)
    6969                && m->m_ext != NULL)
    7070                RTMemFree(m->m_ext);
     
    125125
    126126    DEBUG_CALL("m_get");
    127    
     127
    128128    rc = RTCritSectEnter(&pData->cs_mbuf_zone);
    129129    AssertRC(rc);
     
    383383    {
    384384        m_inc(m, cbBuf);
    385     } 
     385    }
    386386    c = mtod(m, char *);
    387387    memcpy(c, pu8Buf, cbBuf);
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r26404 r26495  
    6363
    6464  /* specific for Unix API */
    65 # define DO_UNIX_CHECK_FD_SET(so, events, fdset) DO_CHECK_FD_SET((so), (events), fdset) 
     65# define DO_UNIX_CHECK_FD_SET(so, events, fdset) DO_CHECK_FD_SET((so), (events), fdset)
    6666  /* specific for Windows Winsock API */
    67 # define DO_WIN_CHECK_FD_SET(so, events, fdset) 0 
     67# define DO_WIN_CHECK_FD_SET(so, events, fdset) 0
    6868
    6969# ifndef RT_OS_LINUX
  • trunk/src/VBox/Devices/Network/slirp/slirp_state.h

    r26423 r26495  
    150150    int mbuf_water_line_limit;
    151151    int mbuf_zone_count;
    152     int fmbuf_water_warn_sent; 
     152    int fmbuf_water_warn_sent;
    153153    uint32_t tsmbuf_water_warn_sent;
    154154#endif
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r26404 r26495  
    628628                            (struct sockaddr *)&addr, &addrlen);
    629629        Log2(("NAT: %R[natsock] ioctlsocket after read "
    630             "(rc:%d errno:%d, n:%d) ret:%d, len:%d\n", so, 
     630            "(rc:%d errno:%d, n:%d) ret:%d, len:%d\n", so,
    631631             rc, errno, n, ret, len));
    632632#else
  • trunk/src/VBox/Devices/PC/DevHPET.cpp

    r26376 r26495  
    927927    /* Lock in R3 must either block or succeed */
    928928    rc = hpetLock(pThis, VERR_IGNORED);
    929    
     929
    930930    AssertLogRelRCReturnVoid(rc);
    931931
  • trunk/src/VBox/Devices/Storage/Debug.cpp

    r12927 r26495  
    580580    uint8_t uASCQ;
    581581    const char * const pszSenseText;
    582 } g_aSCSISenseText[] 
    583 = 
     582} g_aSCSISenseText[]
     583=
    584584{
    585585    { 0x67, 0x02, "A ADD LOGICAL UNIT FAILED" },
     
    920920    if (uSense < RT_ELEMENTS(g_apszSCSISenseNames))
    921921        return g_apszSCSISenseNames[uSense];
    922    
     922
    923923    return "(SCSI sense out of range)";
    924924}
  • trunk/src/VBox/Devices/Storage/VBoxSCSI.cpp

    r26157 r26495  
    355355}
    356356
    357 
    358 
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