Changeset 8569
- Timestamp:
- Sep 21, 2010, 3:57:26 PM (14 years ago)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.ac
r7754 r8569 1 AC_INIT([ariba], [0. 4.0], [http://www.ariba-underlay.org])1 AC_INIT([ariba], [0.5.0], [http://www.ariba-underlay.org]) 2 2 AM_INIT_AUTOMAKE([-Wall foreign]) 3 3 AC_CONFIG_SRCDIR([source/ariba/ariba.h]) -
docu/doxygen/Doxyfile
r7754 r8569 6 6 DOXYFILE_ENCODING = UTF-8 7 7 PROJECT_NAME = Ariba 8 PROJECT_NUMBER = 0. 4.08 PROJECT_NUMBER = 0.5.0 9 9 OUTPUT_DIRECTORY = ./ 10 10 CREATE_SUBDIRS = NO -
source/ariba/communication/networkinfo/NetworkChangeDetection.cpp
r6930 r8569 196 196 } 197 197 198 // somehow all notifications with pid=0 are 199 // invalid and occur much too often 200 if(header->nlmsg_pid == 0) continue; 201 198 202 // 199 203 // here we evaluate the routing netlink message. for, the following 200 204 // messages are of interest: 201 // RTM_NEWLINK, RTM_DELLINK -> interface up/down202 205 // RTM_NEWADDR, RTM_DELADDR -> new address on iface, address deleted from iface 203 // not interesting are:204 // RTM_GETLINK, RTM_GETADDR205 // RTM_NEWROUTE, RTM_DELROUTE, RTM_GETROUTE206 206 // 207 207 … … 209 209 210 210 switch( header->nlmsg_type ){ 211 212 //213 // handle network interface up/down notifications214 // --> link layer notifications215 //216 217 case RTM_NEWLINK:218 case RTM_DELLINK:219 220 changeInfo = obj->extractInterfaceEvent( header );221 break;222 211 223 212 // … … 257 246 } 258 247 259 NetworkChangeInterface::NetworkChangeInfo NetworkChangeDetection::extractInterfaceEvent(struct nlmsghdr* header){260 NetworkChangeInterface::NetworkChangeInfo changeInfo;261 262 //263 // handle network interface up/down notifications264 // the differentiation between up/down is _not_265 // made using new/del-link in the message!266 //267 268 if( header->nlmsg_type == RTM_NEWLINK ){269 logging_debug("network change message RTM_NEWLINK");270 }else if( header->nlmsg_type == RTM_DELLINK ){271 logging_debug("network change message RTM_DELLINK");272 }273 274 if( header->nlmsg_len < NLMSG_LENGTH(sizeof(struct ifinfomsg)) ){275 logging_error( "netlink packet soo small for ifinfomsg" );276 return changeInfo;277 }278 279 //280 // get the interface index and through this281 // further information about the interface282 //283 284 struct ifinfomsg* detailIface = (struct ifinfomsg*)NLMSG_DATA(header);285 changeInfo.interface = networkInformation.getInterface( detailIface->ifi_index );286 287 //288 // check whether device is now up or down289 //290 291 if( changeInfo.interface.isUp && changeInfo.interface.isRunning )292 changeInfo.type = NetworkChangeInterface::EventTypeInterfaceUp;293 else294 changeInfo.type = NetworkChangeInterface::EventTypeInterfaceDown;295 296 297 return changeInfo;298 }299 300 248 NetworkChangeInterface::NetworkChangeInfo NetworkChangeDetection::extractAddressEvent(struct nlmsghdr* header){ 301 249 NetworkChangeInterface::NetworkChangeInfo changeInfo; … … 308 256 if( header->nlmsg_type == RTM_NEWADDR ){ 309 257 logging_debug("network change message RTM_NEWADDR"); 310 changeInfo.type = NetworkChangeInterface::EventType AddressNew;258 changeInfo.type = NetworkChangeInterface::EventTypeInterfaceUp; 311 259 }else if( header->nlmsg_type == RTM_DELADDR ){ 312 260 logging_debug("network change message RTM_DELADDR"); 313 changeInfo.type = NetworkChangeInterface::EventType AddressDelete;261 changeInfo.type = NetworkChangeInterface::EventTypeInterfaceDown; 314 262 } 315 263 -
source/ariba/communication/networkinfo/NetworkChangeDetection.h
r6919 r8569 100 100 NetworkInformation networkInformation; 101 101 102 NetworkChangeInterface::NetworkChangeInfo extractInterfaceEvent( struct nlmsghdr* header );103 102 NetworkChangeInterface::NetworkChangeInfo extractAddressEvent( struct nlmsghdr* header ); 104 103 }; -
source/ariba/communication/networkinfo/NetworkChangeInterface.h
r3690 r8569 55 55 56 56 typedef enum _EventType { 57 EventTypeInvalid, // INVALID57 EventTypeInvalid, // INVALID 58 58 EventTypeInterfaceUp, // network interface came up 59 59 EventTypeInterfaceDown, // network interface went down 60 EventTypeAddressNew, // new network address configured61 EventTypeAddressDelete, // network address deleted62 60 } EventType; 63 61 64 62 static string eventString(EventType ev){ 65 63 switch( ev ){ 66 case EventTypeInvalid: return "invalid type";67 case EventTypeInterfaceUp: return "interface up";64 case EventTypeInvalid: return "invalid type"; 65 case EventTypeInterfaceUp: return "interface up"; 68 66 case EventTypeInterfaceDown: return "interface down"; 69 case EventTypeAddressNew: return "new address"; 70 case EventTypeAddressDelete: return "deleted address"; 71 default: return "unknown event"; 67 default: return "unknown event"; 72 68 } 73 69 }
Note:
See TracChangeset
for help on using the changeset viewer.