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

Changeset 4467


Ignore:
Timestamp:
Sep 24, 2009, 1:00:49 AM (8 years ago)
Author:
stud-dettling
Message:
  • Updated interface of network notification module and network notification client (nwnclient).
Location:
ntlp/branches/20090610-qos-nslp-aho
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • ntlp/branches/20090610-qos-nslp-aho

    • Property svn:ignore
      •  

        old new  
        22BROWSE
        33README
         4gist.conf
  • ntlp/branches/20090610-qos-nslp-aho/gist.conf

    r3701 r4467  
    1515# =======================================================================================
    1616#IPV4_ADDR=192.168.178.21 10.0.1.2
    17 IPV4_ADDR=query
    18 IPV6_ADDR=2001:638:204:c:20c:f1ff:fe77:9e97
     17##IPV4_ADDR=query
     18IPV4_ADDR=192.168.1.15
     19##IPV6_ADDR=2001:638:204:c:20c:f1ff:fe77:9e97
    1920
    20 HOME_ADDR=fdfd:b6f0:1fd4:2001::2
    21 COA_IFACE=eth1
     21##HOME_ADDR=fdfd:b6f0:1fd4:2001::2
     22##COA_IFACE=eth1
    2223
    2324# timing parameters for retry sends
  • ntlp/branches/20090610-qos-nslp-aho/src/network_notification_module.cpp

    r4450 r4467  
    166166      // A lot of debugging messages
    167167      const uint32_t ADDRSTRLEN = INET_ADDRSTRLEN >= INET6_ADDRSTRLEN ? INET_ADDRSTRLEN : INET6_ADDRSTRLEN;
    168       char ip_addr[ADDRSTRLEN];
     168      char ip_addr_ar_n[ADDRSTRLEN];
     169      char ip_addr_mn[ADDRSTRLEN];
    169170      uint8_t *mac;
    170171
     
    174175          Log(DEBUG_LOG, LOG_NORMAL, param.name, "Received Message of type: NWN_MSG_TYPE_AHO");
    175176
    176           if (buffer.aho_msg.nwn_current_ip_type == NWN_ADDRESS_TYPE_IPV4) {
    177             inet_ntop(AF_INET, &buffer.aho_msg.nwn_current_ipv4, ip_addr, ADDRSTRLEN);
    178 
    179             Log(DEBUG_LOG, LOG_NORMAL, param.name, "nwn_current_ip_type: NWN_ADDRESS_TYPE_IPV4");
    180             Log(DEBUG_LOG, LOG_NORMAL, param.name, "nwn_current_ip: " << ip_addr);
    181           }
    182           else if(buffer.aho_msg.nwn_current_ip_type == NWN_ADDRESS_TYPE_IPV6) {
    183             inet_ntop(AF_INET6, &buffer.aho_msg.nwn_current_ipv6, ip_addr, ADDRSTRLEN);
    184 
    185             Log(DEBUG_LOG, LOG_NORMAL, param.name, "nwn_current_ip_type: NWN_ADDRESS_TYPE_IPV6");
    186             Log(DEBUG_LOG, LOG_NORMAL, param.name, "nwn_current_ip: " << ip_addr);
    187           }
    188 
    189           mac = buffer.aho_msg.nwn_new_ap_mac;
     177          Log(DEBUG_LOG, LOG_NORMAL, param.name, "AHO-iface: " << buffer.aho_msg.iface);
     178
     179          mac = buffer.aho_msg.l2_ap_n;
    190180          // typecast to uint32_t is needed because uint8_t is internally of type unsigned char!
    191           Log(DEBUG_LOG, LOG_NORMAL, param.name, "nwn_new_ap_mac: " << setfill('0')
     181          Log(DEBUG_LOG, LOG_NORMAL, param.name, "AHO-l2_ap_n: " << setfill('0') << hex
    192182              << setw(2) << (uint32_t)mac[0] << ":"
    193183              << setw(2) << (uint32_t)mac[1] << ":"
     
    197187              << setw(2) << (uint32_t)mac[5]);
    198188
     189          if (buffer.aho_msg.l3_af == AF_INET) {
     190            inet_ntop(AF_INET, &buffer.aho_msg.l3_ar_n_ipv4, ip_addr_ar_n, ADDRSTRLEN);
     191          }
     192          else if(buffer.aho_msg.l3_af == AF_INET6) {
     193            inet_ntop(AF_INET6, &buffer.aho_msg.l3_ar_n_ipv6, ip_addr_ar_n, ADDRSTRLEN);
     194          }
     195          Log(DEBUG_LOG, LOG_NORMAL, param.name, "AHO-l3_ar_n: " << ip_addr_ar_n);
     196
    199197          break;
    200198
     199
    201200        case NWN_MSG_TYPE_HO:
    202201
    203202          Log(DEBUG_LOG, LOG_NORMAL, param.name, "Received Message of type: NWN_MSG_TYPE_HO");
    204203
    205           if (buffer.ho_msg.nwn_new_ip_type == NWN_ADDRESS_TYPE_IPV4) {
    206             inet_ntop(AF_INET, &buffer.ho_msg.nwn_new_ipv4, ip_addr, ADDRSTRLEN);
    207 
    208             Log(DEBUG_LOG, LOG_NORMAL, param.name, "nwn_new_ip_type: NWN_ADDRESS_TYPE_IPV4");
    209             Log(DEBUG_LOG, LOG_NORMAL, param.name, "nwn_new_ip: " << ip_addr);
    210           }
    211           else if(buffer.ho_msg.nwn_new_ip_type == NWN_ADDRESS_TYPE_IPV6) {
    212             inet_ntop(AF_INET6, &buffer.ho_msg.nwn_new_ipv6, ip_addr, ADDRSTRLEN);
    213 
    214             Log(DEBUG_LOG, LOG_NORMAL, param.name, "nwn_new_ip_type: NWN_ADDRESS_TYPE_IPV6");
    215             Log(DEBUG_LOG, LOG_NORMAL, param.name, "nwn_new_ip: " << ip_addr);
    216           }
     204          Log(DEBUG_LOG, LOG_NORMAL, param.name, "HO-iface: " << buffer.ho_msg.iface);
     205
     206          mac = buffer.ho_msg.l2_ap_n;
     207          // typecast to uint32_t is needed because uint8_t is internally of type unsigned char!
     208          Log(DEBUG_LOG, LOG_NORMAL, param.name, "HO-l2_ap_n: " << setfill('0') << hex
     209              << setw(2) << (uint32_t)mac[0] << ":"
     210              << setw(2) << (uint32_t)mac[1] << ":"
     211              << setw(2) << (uint32_t)mac[2] << ":"
     212              << setw(2) << (uint32_t)mac[3] << ":"
     213              << setw(2) << (uint32_t)mac[4] << ":"
     214              << setw(2) << (uint32_t)mac[5]);
     215
     216          if (buffer.ho_msg.l3_af == AF_INET) {
     217            inet_ntop(AF_INET, &buffer.ho_msg.l3_ar_n_ipv4, ip_addr_ar_n, ADDRSTRLEN);
     218            inet_ntop(AF_INET, &buffer.ho_msg.l3_mn_ipv4, ip_addr_mn, ADDRSTRLEN);
     219          }
     220          else if(buffer.ho_msg.l3_af == AF_INET6) {
     221            inet_ntop(AF_INET6, &buffer.ho_msg.l3_ar_n_ipv6, ip_addr_ar_n, ADDRSTRLEN);
     222            inet_ntop(AF_INET6, &buffer.ho_msg.l3_mn_ipv6, ip_addr_mn, ADDRSTRLEN);
     223          }
     224          Log(DEBUG_LOG, LOG_NORMAL, param.name, "AHO-l3_ar_n: " << ip_addr_ar_n);
     225          Log(DEBUG_LOG, LOG_NORMAL, param.name, "AHO-l3_mn: " << ip_addr_mn);
    217226
    218227          break;
  • ntlp/branches/20090610-qos-nslp-aho/src/ntlp_statemodule_main.cpp

    r4450 r4467  
    525525 * @param homsg -- the message to process
    526526 */
    527 void 
     527void
    528528Statemodule::process_handover_msg(HandoverMsg* homsg)
    529529{
    530530  const struct nwn_uds_msg uds_msg = homsg->get_uds_msg();
    531   nslpdata *data = new nslpdata((uchar *)&uds_msg, sizeof(uds_msg));
    532531
    533532  // Send a NetworkNotification to all registered NSLPs
     
    538537
    539538                if (uds_msg.nwn_msg_type == NWN_MSG_TYPE_AHO) {
     539                        nslpdata *data = new nslpdata((uchar *)&uds_msg.aho_msg, sizeof(aho_msg_body));
    540540                        msg->set_networknotification(data, (*cur).first, 0, NULL,
    541541                                        APIMsg::anticipated_handover_event, 0);
    542542                }
    543543                else if (uds_msg.nwn_msg_type == NWN_MSG_TYPE_HO) {
     544                        nslpdata *data = new nslpdata((uchar *)&uds_msg.ho_msg, sizeof(ho_msg_body));
    544545                        msg->set_networknotification(data, (*cur).first, 0, NULL,
    545546                                        APIMsg::handover_event, 0);
Note: See TracChangeset for help on using the changeset viewer.