VirtualBox

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


Ignore:
Timestamp:
Jan 23, 2009 10:26:21 PM (16 years ago)
Author:
vboxsync
Message:

NAT:

  1. introduces TFTP special_address | CTL_TFTP(4) for built-in address
  2. can connect to other then built-in tftp
Location:
trunk/src/VBox/Devices/Network/slirp
Files:
4 edited

Legend:

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

    r15890 r16213  
    206206        RTStrPrintf((char*)rbp->bp_file, sizeof(rbp->bp_file), "%s", bootp_filename);
    207207
    208     saddr.sin_addr.s_addr = htonl(ntohl(special_addr.s_addr) | CTL_ALIAS);
     208    saddr.sin_addr.s_addr = htonl(ntohl(special_addr.s_addr) | CTL_TFTP);
    209209    saddr.sin_port = htons(BOOTP_SERVER);
    210210
  • trunk/src/VBox/Devices/Network/slirp/ctl.h

    r15093 r16213  
    33#define CTL_ALIAS       2
    44#define CTL_DNS         3
     5#define CTL_TFTP        4
    56#define CTL_BROADCAST   255
    67
     8#define CTL_CHECK(x, ctl) (((x) & ~pData->netmask) == (ctl))
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r16063 r16213  
    10001000            if ((htip & pData->netmask) == ntohl(special_addr.s_addr))
    10011001            {
    1002                 if (   (htip & ~pData->netmask) == CTL_DNS
    1003                     || (htip & ~pData->netmask) == CTL_ALIAS)
     1002                if (   CTL_CHECK(htip,CTL_DNS)
     1003                    || CTL_CHECK(htip, CTL_ALIAS)
     1004                    || CTL_CHECK(htip, CTL_TFTP))
    10041005                    goto arp_ok;
    10051006                for (ex_ptr = exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next)
  • trunk/src/VBox/Devices/Network/slirp/udp.c

    r15845 r16213  
    4545#include <slirp.h>
    4646#include "ip_icmp.h"
     47#include "ctl.h"
    4748
    4849
     
    159160     *  handle TFTP
    160161     */
    161     if (ntohs(uh->uh_dport) == TFTP_SERVER)
     162    if (   ntohs(uh->uh_dport) == TFTP_SERVER
     163            && CTL_CHECK(ntohl(ip->ip_dst.s_addr), CTL_TFTP))
    162164    {
    163165        tftp_input(pData, m);
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