NSIS-ka
A free C++ implementation of NSIS protocols

Changeset 4149


Ignore:
Timestamp:
Jul 22, 2009, 6:00:36 PM (8 years ago)
Author:
bless
Message:
  • added AddressList? parameter initializing from configured addresses, doesn't work yet properly
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ntlp/branches/20081127-merge-mobility-mk3/src/ntlp_starter.cpp

    r4147 r4149  
    315315  if (param.addresses == 0) {
    316316    addresses = new AddressList();
    317     addresses->add_host_prop(NULL, AddressList::ConfiguredAddr_P);
     317    hostaddresslist_t& ntlpv4addr= gconf.getparref< hostaddresslist_t >(gistconf_localaddrv4);
     318    hostaddresslist_t& ntlpv6addr= gconf.getparref< hostaddresslist_t >(gistconf_localaddrv6);
     319
     320    if (!ntlpv4addr.empty())
     321    {
     322            hostaddresslist_t::iterator it= ntlpv4addr.begin();
     323            netaddress na;
     324            na.set_pref_len(32);
     325            while (it != ntlpv4addr.end())
     326            {
     327                    na= *it;
     328                    addresses->add_property(na, AddressList::ConfiguredAddr_P);
     329                    it++;
     330            } // end while
     331    }
     332
     333    if (!ntlpv6addr.empty())
     334    {
     335            hostaddresslist_t::iterator it= ntlpv6addr.begin();
     336            netaddress na;
     337            na.set_pref_len(64);
     338           
     339            while (it != ntlpv6addr.end())
     340            {
     341                    na= *it;
     342                    addresses->add_property(na, AddressList::ConfiguredAddr_P);
     343                    it++;
     344            } // end while
     345    }
     346   
     347    if (ntlpv4addr.empty() && ntlpv6addr.empty())
     348            addresses->add_host_prop(NULL, AddressList::ConfiguredAddr_P);
    318349  }
    319350  else {
Note: See TracChangeset for help on using the changeset viewer.