~ubuntu-branches/ubuntu/vivid/virtualbox-ose/vivid

« back to all changes in this revision

Viewing changes to src/VBox/Devices/Network/slirp/debug.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-10-13 23:06:00 UTC
  • mfrom: (0.3.2 upstream) (0.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20091013230600-xhu2pwizq0wo63l9
Tags: 3.0.8-dfsg-1ubuntu1
* Merge from debian unstable (LP: #444812), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
* Try to remove existing dkms modules before adding the new modules
  (LP: #434503)
  - debian/virtualbox-ose-source.postinst
  - debian/virtualbox-ose-guest-source.postinst
* Don't fail if dkms modules have already been removed
  - debian/virtualbox-ose-source.prerm
  - debian/virtualbox-ose-guest-source.prerm

Show diffs side-by-side

added added

removed removed

Lines of Context:
246
246
 
247
247
    AssertReturn(strcmp(pszType, "ether") == 0, 0);
248
248
    if (ether != NULL)
249
 
        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 
 
249
        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
250
250
            "[ether %hhx:%hhx:%hhx:%hhx:%hhx:%hhx]",
251
 
            ether[0], ether[1], ether[2], 
 
251
            ether[0], ether[1], ether[2],
252
252
            ether[3], ether[4], ether[5]);
253
253
    else
254
254
        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "[ether null]");
268
268
    int status = 0;
269
269
 
270
270
    AssertReturn(strcmp(pszType, "natsock") == 0, 0);
271
 
    if (so == NULL) 
272
 
        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 
 
271
    if (so == NULL)
 
272
        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
273
273
                "socket is null");
274
 
    if (so->so_state == SS_NOFDREF || so->s == -1) 
275
 
        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 
 
274
    if (so->so_state == SS_NOFDREF || so->s == -1)
 
275
        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
276
276
                "socket(%d) SS_NODREF",so->s);
277
277
    status = getsockname(so->s, &addr, &socklen);
278
278
 
279
 
    if(status != 0 || addr.sa_family != AF_INET)
 
279
    if (status != 0 || addr.sa_family != AF_INET)
280
280
    {
281
 
        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, 
 
281
        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
282
282
                "socket(%d) is invalid(probably closed)",so->s);
283
283
    }
284
284
 
287
287
    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "socket %4d:(proto:%u) "
288
288
            "state=%04x ip=" IP4_ADDR_PRINTF_FORMAT ":%d "
289
289
            "name=" IP4_ADDR_PRINTF_FORMAT ":%d",
290
 
            so->s, so->so_type, so->so_state, IP4_ADDR_PRINTF_DECOMP(ip), 
291
 
            ntohs(so->so_fport), 
 
290
            so->s, so->so_type, so->so_state, IP4_ADDR_PRINTF_DECOMP(ip),
 
291
            ntohs(so->so_fport),
292
292
            IP4_ADDR_PRINTF_DECOMP(ntohl(in_addr->sin_addr.s_addr)),
293
293
            ntohs(in_addr->sin_port));
294
294
}
306
306
 
307
307
    AssertReturn(strcmp(pszType, "natwinnetevents") == 0, 0);
308
308
 
309
 
    cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "events=%02x (", 
 
309
    cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "events=%02x (",
310
310
            pNetworkEvents->lNetworkEvents);
311
311
# define DO_BIT(bit) \
312
312
    if (pNetworkEvents->lNetworkEvents & FD_ ## bit)                        \
351
351
    if (!g_fFormatRegistered)
352
352
    {
353
353
        /*
354
 
         * XXX(r - frank): Move this to IPRT using RTNETADDRIPV4. 
 
354
         * XXX(r - frank): Move this to IPRT using RTNETADDRIPV4.
355
355
         * Use the specifier %RNAipv4.
356
356
         */
357
357
        rc = RTStrFormatTypeRegister("IP4", print_ipv4_address, NULL);
360
360
        AssertRC(rc);
361
361
        rc = RTStrFormatTypeRegister("natsock", print_socket, NULL);
362
362
        AssertRC(rc);
363
 
        rc = RTStrFormatTypeRegister("natwinnetevents", 
 
363
        rc = RTStrFormatTypeRegister("natwinnetevents",
364
364
            print_networkevents, NULL);
365
365
        AssertRC(rc);
366
366
        g_fFormatRegistered = 1;