Changeset 048cd69 in mainline for uspace/lib/c/include
- Timestamp:
- 2015-06-07T15:41:04Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 204ba47
- Parents:
- 4d11204 (diff), c3f7d37 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/lib/c/include
- Files:
-
- 3 added
- 10 deleted
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/errno.h
r4d11204 r048cd69 68 68 #define ENAK (-303) 69 69 70 /** An API function is called while another blocking function is in progress. */71 #define EINPROGRESS (-10036)72 73 /** The socket identifier is not valid. */74 #define ENOTSOCK (-10038)75 76 /** The destination address required. */77 #define EDESTADDRREQ (-10039)78 79 /** Protocol is not supported. */80 #define EPROTONOSUPPORT (-10043)81 82 /** Socket type is not supported. */83 #define ESOCKTNOSUPPORT (-10044)84 85 /** Protocol family is not supported. */86 #define EPFNOSUPPORT (-10046)87 88 /** Address family is not supported. */89 #define EAFNOSUPPORT (-10047)90 91 /** Address is already in use. */92 #define EADDRINUSE (-10048)93 94 /** The socket is not connected or bound. */95 #define ENOTCONN (-10057)96 97 #define ECONNREFUSED (-10058)98 99 #define ECONNABORTED (-10059)100 101 70 /** The requested operation was not performed. Try again later. */ 102 71 #define EAGAIN (-11002) 103 104 /** No data. */105 #define NO_DATA (-11004)106 72 107 73 #endif -
uspace/lib/c/include/fibril_synch.h
r4d11204 r048cd69 135 135 fid_t fibril; 136 136 fibril_timer_state_t state; 137 bool handler_running; 137 /** FID of fibril executing handler or 0 if handler is not running */ 138 fid_t handler_fid; 138 139 139 140 suseconds_t delay; -
uspace/lib/c/include/inet/addr.h
r4d11204 r048cd69 37 37 38 38 #include <stdint.h> 39 #include <net/in.h>40 #include <net/in6.h>41 #include <net/socket.h>42 39 43 40 typedef uint32_t addr32_t; … … 126 123 extern void inet_addr_set(addr32_t, inet_addr_t *); 127 124 extern void inet_naddr_set(addr32_t, uint8_t, inet_naddr_t *); 128 extern void inet_sockaddr_in_addr(const sockaddr_in_t *, inet_addr_t *);129 125 130 126 extern void inet_addr_set6(addr128_t, inet_addr_t *); 131 127 extern void inet_naddr_set6(addr128_t, uint8_t, inet_naddr_t *); 132 extern void inet_sockaddr_in6_addr(const sockaddr_in6_t *, inet_addr_t *);133 134 extern uint16_t inet_addr_sockaddr_in(const inet_addr_t *, sockaddr_in_t *,135 sockaddr_in6_t *);136 137 extern ip_ver_t ipver_from_af(int af);138 extern int inet_addr_sockaddr(const inet_addr_t *, uint16_t, sockaddr_t **,139 socklen_t *);140 128 141 129 #endif -
uspace/lib/c/include/inet/endpoint.h
r4d11204 r048cd69 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 28 28 29 29 /** @addtogroup libc 30 * @{ 30 * @{ 31 */ 32 /** @file 31 33 */ 32 34 33 /** @file 34 * Character string to integer map. 35 #ifndef LIBC_INET_ASSOC_H_ 36 #define LIBC_INET_ASSOC_H_ 37 38 #include <stdint.h> 39 #include <inet/addr.h> 40 #include <loc.h> 41 42 /** Internet port number ranges 43 * 44 * Port number ranges per RFC 6335 section 6 (Port Number Ranges. 45 * Technically port zero is a system port. But since it is reserved, 46 * we will use it as a special value denoting no port is specified 47 * and we will exclude it from the system port range to disallow 48 * ever assigning it. 35 49 */ 36 37 #ifndef LIBC_CHAR_MAP_H_ 38 #define LIBC_CHAR_MAP_H_ 39 40 #include <libarch/types.h> 41 42 /** Invalid assigned value used also if an entry does not exist. */ 43 #define CHAR_MAP_NULL (-1) 44 45 /** Type definition of the character string to integer map. 46 * @see char_map 47 */ 48 typedef struct char_map char_map_t; 49 50 /** Character string to integer map item. 51 * 52 * This structure recursivelly contains itself as a character by character tree. 53 * The actually mapped character string consists of all the parent characters 54 * and the actual one. 55 */ 56 struct char_map { 57 /** Actually mapped character. */ 58 uint8_t c; 59 /** Stored integral value. */ 60 int value; 61 /** Next character array size. */ 62 int size; 63 /** First free position in the next character array. */ 64 int next; 65 /** Next character array. */ 66 char_map_t **items; 67 /** Consistency check magic value. */ 68 int magic; 50 enum inet_port_ranges { 51 /** Special value meaning no specific port */ 52 inet_port_any = 0, 53 /** Lowest system port (a.k.a. well known port) */ 54 inet_port_sys_lo = 1, 55 /** Highest system port (a.k.a. well known port) */ 56 inet_port_sys_hi = 1023, 57 /** Lowest user port (a.k.a. registered port) */ 58 inet_port_user_lo = 1024, 59 /** Highest user port (a.k.a. registered port) */ 60 inet_port_user_hi = 49151, 61 /** Lowest dynamic port (a.k.a. private or ephemeral port) */ 62 inet_port_dyn_lo = 49152, 63 /** Highest dynamic port (a.k.a. private or ephemeral port) */ 64 inet_port_dyn_hi = 65535 69 65 }; 70 66 71 extern int char_map_initialize(char_map_t *); 72 extern void char_map_destroy(char_map_t *); 73 extern int char_map_exclude(char_map_t *, const uint8_t *, size_t); 74 extern int char_map_add(char_map_t *, const uint8_t *, size_t, const int); 75 extern int char_map_find(const char_map_t *, const uint8_t *, size_t); 76 extern int char_map_update(char_map_t *, const uint8_t *, size_t, const int); 67 /** Internet endpoint (address-port pair), a.k.a. socket */ 68 typedef struct { 69 inet_addr_t addr; 70 uint16_t port; 71 } inet_ep_t; 72 73 /** Internet endpoint pair */ 74 typedef struct { 75 service_id_t local_link; 76 inet_ep_t local; 77 inet_ep_t remote; 78 } inet_ep2_t; 79 80 extern void inet_ep_init(inet_ep_t *); 81 extern void inet_ep2_init(inet_ep2_t *); 77 82 78 83 #endif -
uspace/lib/c/include/inet/iplink.h
r4d11204 r048cd69 44 44 async_sess_t *sess; 45 45 struct iplink_ev_ops *ev_ops; 46 void *arg; 46 47 } iplink_t; 47 48 … … 81 82 } iplink_ev_ops_t; 82 83 83 extern int iplink_open(async_sess_t *, iplink_ev_ops_t *, iplink_t **);84 extern int iplink_open(async_sess_t *, iplink_ev_ops_t *, void *, iplink_t **); 84 85 extern void iplink_close(iplink_t *); 85 86 extern int iplink_send(iplink_t *, iplink_sdu_t *); … … 90 91 extern int iplink_get_mac48(iplink_t *, addr48_t *); 91 92 extern int iplink_set_mac48(iplink_t *, addr48_t); 93 extern void *iplink_get_userptr(iplink_t *); 92 94 93 95 #endif -
uspace/lib/c/include/ipc/services.h
r4d11204 r048cd69 49 49 SERVICE_IRC = FOURCC('i', 'r', 'c', ' '), 50 50 SERVICE_CLIPBOARD = FOURCC('c', 'l', 'i', 'p'), 51 SERVICE_UDP = FOURCC('u', 'd', 'p', ' '),52 SERVICE_TCP = FOURCC('t', 'c', 'p', ' ')53 51 } services_t; 54 52 … … 61 59 #define SERVICE_NAME_INETPING6 "net/inetping6" 62 60 #define SERVICE_NAME_NETCONF "net/netconf" 61 #define SERVICE_NAME_UDP "net/udp" 62 #define SERVICE_NAME_TCP "net/tcp" 63 63 64 64 #endif -
uspace/lib/c/include/ipc/udp.h
r4d11204 r048cd69 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2015 Jiri Svobda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libc 30 * @{ 29 /** @addtogroup libcipc 30 * @{ 31 */ 32 /** @file 31 33 */ 32 34 33 /** @file 34 * Internet protocol numbers according to the on-line IANA - Assigned Protocol 35 * numbers: 36 * 37 * http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml 38 */ 35 #ifndef LIBC_IPC_UDP_H_ 36 #define LIBC_IPC_UDP_H_ 39 37 40 #ifndef LIBC_IP_PROTOCOLS_H_ 41 #define LIBC_IP_PROTOCOLS_H_ 38 #include <ipc/common.h> 42 39 43 /** @name IP protocols definitions */ 44 /*@{*/ 40 typedef enum { 41 UDP_CALLBACK_CREATE = IPC_FIRST_USER_METHOD, 42 UDP_ASSOC_CREATE, 43 UDP_ASSOC_DESTROY, 44 UDP_ASSOC_SEND_MSG, 45 UDP_RMSG_INFO, 46 UDP_RMSG_READ, 47 UDP_RMSG_DISCARD 48 } udp_request_t; 45 49 46 #define IPPROTO_ICMP 1 47 #define IPPROTO_TCP 6 48 #define IPPROTO_UDP 17 49 #define IPPROTO_ICMPV6 58 50 51 /*@}*/ 50 typedef enum { 51 UDP_EV_DATA = IPC_FIRST_USER_METHOD 52 } udp_event_t; 52 53 53 54 #endif
Note:
See TracChangeset
for help on using the changeset viewer.