1 /**
2  * Copyright (c) 2023-2024 Marcin Niestroj
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef __DRIVERS_NET_NSOS_NETDB_H__
8 #define __DRIVERS_NET_NSOS_NETDB_H__
9 
10 enum nsos_resolve_status {
11 	/** Invalid value for `ai_flags' field */
12 	NSOS_MID_EAI_BADFLAGS    = -1,
13 	/** NAME or SERVICE is unknown */
14 	NSOS_MID_EAI_NONAME      = -2,
15 	/** Temporary failure in name resolution */
16 	NSOS_MID_EAI_AGAIN       = -3,
17 	/** Non-recoverable failure in name res */
18 	NSOS_MID_EAI_FAIL        = -4,
19 	/** `ai_family' not supported */
20 	NSOS_MID_EAI_FAMILY      = -6,
21 	/** `ai_socktype' not supported */
22 	NSOS_MID_EAI_SOCKTYPE    = -7,
23 	/** SRV not supported for `ai_socktype' */
24 	NSOS_MID_EAI_SERVICE     = -8,
25 	/** Memory allocation failure */
26 	NSOS_MID_EAI_MEMORY      = -10,
27 	/** System error returned in `errno' */
28 	NSOS_MID_EAI_SYSTEM      = -11,
29 	/** Argument buffer overflow */
30 	NSOS_MID_EAI_OVERFLOW    = -12,
31 };
32 
33 int eai_to_nsos_mid(int err);
34 int eai_from_nsos_mid(int err);
35 
36 #endif /* __DRIVERS_NET_NSOS_NETDB_H__ */
37