Lines Matching refs:from

24 /*!	Routing utility function: copies address \a from into a new address
26 If \a replaceWithZeros is set \a from will be replaced by an empty
28 If a \a mask is given it is applied to \a from (such that \a to is the
29 result of \a from & \a mask).
32 \return B_BAD_VALUE if any of \a from or \a mask refers to an uninitialized
37 ipv4_copy_address(const sockaddr *from, sockaddr **to,
49 if (from == NULL)
51 if (from->sa_len == 0 || (mask != NULL && mask->sa_len == 0))
53 if (from->sa_family != AF_INET)
60 memcpy(*to, from, sizeof(sockaddr_in));
113 \return false if \a address is NULL, or with family different from AF_INET
246 // A mask (from LSB) starts with zeros, after the first one, only ones
342 /*! Sets \a address to \a from.
343 \return B_OK if \a from has been copied into \a address
344 \return B_BAD_VALUE if either \a address or \a from is NULL or if the
345 address given in from has not been initialized
346 \return B_MISMATCHED_VALUES if from is not of family AF_INET
349 ipv4_set_to(sockaddr *address, const sockaddr *from)
351 if (address == NULL || from == NULL || from->sa_len == 0)
354 if (from->sa_family != AF_INET)
357 memcpy(address, from, sizeof(sockaddr_in));
363 /*! Updates missing parts in \a address with the values in \a from.
364 \return B_OK if \a address has been updated from \a from
365 \return B_BAD_VALUE if either \a address or \a from is NULL or if the
366 address given in from has not been initialized
367 \return B_MISMATCHED_VALUES if from is not of family AF_INET
373 const sockaddr_in *from = (const sockaddr_in *)_from;
375 if (address == NULL || from == NULL || from->sin_len == 0)
378 if (from->sin_family != AF_INET)
385 address->sin_port = from->sin_port;
388 address->sin_addr.s_addr = from->sin_addr.s_addr;