Lines Matching refs:entry

244 get_request_buffer(ndp_entry* entry)
246 net_buffer* buffer = entry->request_buffer;
250 buffer = atomic_pointer_test_and_set(&entry->request_buffer,
260 put_request_buffer(ndp_entry* entry, net_buffer* buffer)
263 &entry->request_buffer, buffer, (net_buffer*)NULL);
272 delete_request_buffer(ndp_entry* entry)
274 net_buffer* buffer = atomic_pointer_get_and_set(&entry->request_buffer,
294 ndp_entry* entry = new (std::nothrow) ndp_entry;
295 if (entry == NULL)
298 entry->protocol_address = protocolAddress;
299 entry->flags = flags;
300 entry->timestamp = system_time();
301 entry->protocol = NULL;
302 entry->request_buffer = NULL;
303 entry->timer_state = NDP_NO_STATE;
304 sStackModule->init_timer(&entry->timer, ndp_timer, entry);
307 // this entry is already resolved
308 entry->hardware_address = *hardwareAddress;
309 entry->hardware_address.sdl_e_type = htons(ETHER_TYPE_IPV6);
311 // this entry still needs to be resolved
312 entry->hardware_address.sdl_alen = 0;
314 if (entry->hardware_address.sdl_len != sizeof(sockaddr_dl)) {
316 entry->hardware_address.sdl_len = sizeof(sockaddr_dl);
319 if (sCache->Insert(entry) != B_OK) {
320 // We can delete the entry here with the sCacheLock held, since it's
322 delete entry;
326 return entry;
355 TRACE(("NDP entry %p Marked as FAILED\n", this));
365 TRACE(("NDP entry %p Marked as VALID\n", this));
386 // schedule a timer to remove this entry
436 /*! Updates the entry determined by \a protocolAddress with the specified
438 If such an entry does not exist yet, a new entry is added. If you try
439 to update a local existing entry but didn't ask for it (by setting
451 ndp_entry* entry = ndp_entry::Lookup(protocolAddress);
452 if (entry != NULL) {
459 && entry->hardware_address.sdl_alen != 0
460 && memcmp(LLADDR(&entry->hardware_address),
471 entry->hardware_address = *hardwareAddress;
472 entry->timestamp = system_time();
474 entry = ndp_entry::Add(protocolAddress, hardwareAddress, flags);
475 if (entry == NULL)
479 delete_request_buffer(entry);
481 if ((entry->flags & NDP_FLAG_PERMANENT) == 0) {
483 entry->timer_state = NDP_STATE_STALE;
484 sStackModule->set_timer(&entry->timer, NDP_STALE_TIMEOUT);
487 if ((entry->flags & NDP_FLAG_REJECT) != 0)
488 entry->MarkFailed();
490 entry->MarkValid();
493 *_entry = entry;
530 ndp_entry* entry = ndp_entry::Lookup(inetAddress);
531 if (entry != NULL) {
532 sCache->Remove(entry);
533 entry->flags |= NDP_FLAG_REMOVED;
552 delete entry;
621 ndp_entry* entry;
623 NDP_FLAG_LOCAL | NDP_FLAG_PERMANENT, &entry);
625 entry->protocol = protocol;
633 Returns an error if no entry could be added.
693 ndp_entry* entry = ndp_entry::Lookup(header.target_address);
694 if (entry == NULL
695 || (entry->flags & (NDP_FLAG_LOCAL | NDP_FLAG_PUBLISH)) == 0) {
711 memcpy(&header.link_address, LLADDR(&entry->hardware_address),
819 ndp_entry* entry = (ndp_entry*)data;
820 TRACE(("NDP timer %" B_PRId32 ", entry %p!\n", entry->timer_state, entry));
822 switch (entry->timer_state) {
828 // Requesting the NDP entry failed, we keep it around for a while,
831 TRACE((" requesting NDP entry %p failed!\n", entry));
832 entry->timer_state = NDP_STATE_REMOVE_FAILED;
833 entry->MarkFailed();
834 sStackModule->set_timer(&entry->timer, NDP_REJECT_TIMEOUT);
839 // the entry has aged so much that we're going to remove it
840 TRACE((" remove NDP entry %p!\n", entry));
843 if ((entry->flags & NDP_FLAG_REMOVED) != 0) {
844 // The entry has already been removed, and is about to be deleted
849 sCache->Remove(entry);
852 delete entry;
857 if (entry->timer_state > NDP_STATE_LAST_REQUEST)
860 TRACE((" send request for NDP entry %p!\n", entry));
862 net_buffer* request = get_request_buffer(entry);
866 if (entry->timer_state < NDP_STATE_LAST_REQUEST) {
873 entry->timer_state = NDP_STATE_LAST_REQUEST;
875 put_request_buffer(entry, request);
888 entry->timer_state++;
889 sStackModule->set_timer(&entry->timer, NDP_REQUEST_TIMEOUT);
902 // create an unresolved entry as a placeholder
903 ndp_entry* entry = ndp_entry::Add(address, NULL, 0);
904 if (entry == NULL)
909 net_buffer* buffer = entry->request_buffer = gBufferModule->create(256);
910 if (entry->request_buffer == NULL) {
911 entry->ScheduleRemoval();
918 entry->ScheduleRemoval();
949 entry->ScheduleRemoval();
962 entry->ScheduleRemoval();
970 entry->ScheduleRemoval();
974 entry->protocol = protocol;
975 entry->timer_state = NDP_STATE_REQUEST;
976 sStackModule->set_timer(&entry->timer, 0);
979 *_entry = entry;
1039 ndp_entry* entry = ndp_entry::Lookup(
1041 if (entry == NULL) {
1043 ((struct sockaddr_in6*)buffer->destination)->sin6_addr, &entry);
1048 if ((entry->flags & NDP_FLAG_REJECT) != 0)
1050 if (!(entry->flags & NDP_FLAG_VALID)) {
1051 // entry is still being resolved.
1052 TRACE(("NDP Queuing packet %p, entry still being resolved.\n",
1054 entry->queue.Add(buffer);
1058 memcpy(buffer->destination, &entry->hardware_address,
1059 entry->hardware_address.sdl_len);
1109 // Update NDP entry for the local address