Lines Matching refs:ptr
25 struct session *ptr; in get_free_session() local
35 ptr = &sessions[proto][i]; in get_free_session()
37 if (ptr->state == STATE_NULL || in get_free_session()
38 ptr->state == STATE_COMPLETED) { in get_free_session()
40 if (oldest == 0ULL || ptr->last_time < oldest) { in get_free_session()
41 oldest = ptr->last_time; in get_free_session()
43 if (ptr->state == STATE_COMPLETED) { in get_free_session()
59 ptr = NULL; in get_free_session()
62 ptr = &sessions[proto][oldest_free_index]; in get_free_session()
64 ptr = &sessions[proto][oldest_completed_index]; in get_free_session()
67 if (ptr != NULL) { in get_free_session()
70 ptr->port = addr4->sin_port; in get_free_session()
71 ptr->ip.family = AF_INET; in get_free_session()
72 net_ipaddr_copy(&ptr->ip.in_addr, &addr4->sin_addr); in get_free_session()
75 ptr->port = addr6->sin6_port; in get_free_session()
76 ptr->ip.family = AF_INET6; in get_free_session()
77 net_ipaddr_copy(&ptr->ip.in6_addr, &addr6->sin6_addr); in get_free_session()
80 ptr->state = STATE_STARTING; in get_free_session()
83 return ptr; in get_free_session()
103 struct session *ptr = &sessions[proto][i]; in get_session() local
107 ptr->ip.family == AF_INET && in get_session()
108 ptr->port == addr4->sin_port && in get_session()
109 net_ipv4_addr_cmp(&ptr->ip.in_addr, &addr4->sin_addr)) { in get_session()
111 active = ptr; in get_session()
117 ptr->ip.family == AF_INET6 && in get_session()
118 ptr->port == addr6->sin6_port && in get_session()
119 net_ipv6_addr_cmp(&ptr->ip.in6_addr, &addr6->sin6_addr)) { in get_session()
121 active = ptr; in get_session()
125 if (!free && (ptr->state == STATE_NULL || in get_session()
126 ptr->state == STATE_COMPLETED)) { in get_session()
128 free = ptr; in get_session()