Changeset 6843a9c in mainline for uspace/lib/c/include
- Timestamp:
- 2012-06-29T13:02:14Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 722912e
- Parents:
- ba72f2b (diff), 0bbd13e (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:
-
- 5 added
- 10 deleted
- 28 edited
- 6 moved
-
adt/measured_strings.h (deleted)
-
as.h (modified) (2 diffs)
-
async.h (modified) (4 diffs)
-
bitops.h (modified) (1 diff)
-
ddi.h (modified) (1 diff)
-
device/hw_res.h (modified) (3 diffs)
-
device/hw_res_parsed.h (modified) (2 diffs)
-
device/nic.h (modified) (3 diffs)
-
device/pci.h (moved) (moved from uspace/lib/c/include/ipc/net_net.h ) (2 diffs)
-
devman.h (modified) (2 diffs)
-
errno.h (modified) (2 diffs)
-
fibril.h (modified) (2 diffs)
-
fibril_synch.h (modified) (2 diffs)
-
inet/inet.h (moved) (moved from uspace/lib/net/include/net_hardware.h ) (3 diffs)
-
inet/inetcfg.h (added)
-
inet/inetping.h (moved) (moved from uspace/srv/hw/char/i8042/i8042.h ) (2 diffs)
-
inet/iplink.h (added)
-
inet/iplink_srv.h (added)
-
ipc/devman.h (modified) (2 diffs)
-
ipc/icmp.h (deleted)
-
ipc/inet.h (moved) (moved from uspace/srv/net/net/packet_server.h ) (2 diffs)
-
ipc/ip.h (deleted)
-
ipc/ipc.h (modified) (2 diffs)
-
ipc/iplink.h (added)
-
ipc/loc.h (modified) (1 diff)
-
ipc/net.h (deleted)
-
ipc/netif.h (deleted)
-
ipc/nil.h (deleted)
-
ipc/packet.h (deleted)
-
ipc/services.h (modified) (1 diff)
-
ipc/socket.h (modified) (1 diff)
-
ipc/vfs.h (modified) (2 diffs)
-
loc.h (modified) (2 diffs)
-
net/device.h (modified) (3 diffs)
-
net/icmp_codes.h (deleted)
-
net/in.h (modified) (1 diff)
-
net/packet.h (deleted)
-
net/packet_header.h (deleted)
-
nic/eth_phys.h (moved) (moved from uspace/lib/c/include/net/eth_phys.h ) (1 diff)
-
nic/nic.h (added)
-
ns.h (modified) (1 diff)
-
stdarg.h (modified) (1 diff)
-
stdio.h (modified) (1 diff)
-
str.h (modified) (3 diffs)
-
sys/mman.h (modified) (1 diff)
-
sysinfo.h (modified) (1 diff)
-
unistd.h (modified) (2 diffs)
-
vfs/vfs.h (modified) (2 diffs)
-
vfs/vfs_mtab.h (moved) (moved from uspace/lib/c/include/ipc/tl.h ) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/as.h
rba72f2b r6843a9c 41 41 #include <libarch/config.h> 42 42 43 #define AS_AREA_ANY ((void *) -1) 44 #define AS_MAP_FAILED ((void *) -1) 45 43 46 static inline size_t SIZE2PAGES(size_t size) 44 47 { … … 59 62 extern int as_area_destroy(void *); 60 63 extern void *set_maxheapsize(size_t); 61 extern void *as_get_mappable_page(size_t);62 64 extern int as_get_physical_mapping(const void *, uintptr_t *); 63 65 -
uspace/lib/c/include/async.h
rba72f2b r6843a9c 139 139 extern void async_wait_for(aid_t, sysarg_t *); 140 140 extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t); 141 extern void async_forget(aid_t); 141 142 142 143 extern fid_t async_new_connection(task_id_t, sysarg_t, ipc_callid_t, … … 320 321 sysarg_t *, sysarg_t *); 321 322 322 extern async_sess_t *async_c onnect_me(exch_mgmt_t, async_exch_t *);323 extern async_sess_t *async_clone_establish(exch_mgmt_t, async_exch_t *); 323 324 extern async_sess_t *async_connect_me_to(exch_mgmt_t, async_exch_t *, sysarg_t, 324 325 sysarg_t, sysarg_t); … … 346 347 */ 347 348 348 #define async_share_in_start_0_0(exch, dst, size) \349 async_share_in_start(exch, dst, size, 0, NULL)350 #define async_share_in_start_0_1(exch, dst, size, flags) \351 async_share_in_start(exch, dst, size, 0, flags)352 #define async_share_in_start_1_0(exch, dst, size, arg) \353 async_share_in_start(exch, dst, size, arg, NULL)354 #define async_share_in_start_1_1(exch, dst, size, arg, flags) \355 async_share_in_start(exch, dst, size, arg, flags)356 357 extern int async_share_in_start(async_exch_t *, void *,size_t, sysarg_t,358 unsigned int * );349 #define async_share_in_start_0_0(exch, size, dst) \ 350 async_share_in_start(exch, size, 0, NULL, dst) 351 #define async_share_in_start_0_1(exch, size, flags, dst) \ 352 async_share_in_start(exch, size, 0, flags, dst) 353 #define async_share_in_start_1_0(exch, size, arg, dst) \ 354 async_share_in_start(exch, size, arg, NULL, dst) 355 #define async_share_in_start_1_1(exch, size, arg, flags, dst) \ 356 async_share_in_start(exch, size, arg, flags, dst) 357 358 extern int async_share_in_start(async_exch_t *, size_t, sysarg_t, 359 unsigned int *, void **); 359 360 extern bool async_share_in_receive(ipc_callid_t *, size_t *); 360 361 extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int); … … 362 363 extern int async_share_out_start(async_exch_t *, void *, unsigned int); 363 364 extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *); 364 extern int async_share_out_finalize(ipc_callid_t, void * );365 extern int async_share_out_finalize(ipc_callid_t, void **); 365 366 366 367 /* -
uspace/lib/c/include/bitops.h
rba72f2b r6843a9c 40 40 /** Mask with bit @a n set. */ 41 41 #define BIT_V(type, n) \ 42 ((type) 1 << ((n) - 1))42 ((type) 1 << (n)) 43 43 44 44 /** Mask with rightmost @a n bits set. */ 45 45 #define BIT_RRANGE(type, n) \ 46 (BIT_V(type, (n) + 1) - 1)46 (BIT_V(type, (n)) - 1) 47 47 48 48 /** Mask with bits @a hi .. @a lo set. @a hi >= @a lo. */ -
uspace/lib/c/include/ddi.h
rba72f2b r6843a9c 41 41 42 42 extern int device_assign_devno(void); 43 extern int physmem_map(void *, void *, unsigned long, int); 43 44 extern int physmem_map(void *, size_t, unsigned int, void **); 45 46 extern int dmamem_map(void *, size_t, unsigned int, unsigned int, void **); 47 extern int dmamem_map_anonymous(size_t, unsigned int, unsigned int, void **, 48 void **); 49 extern int dmamem_unmap(void *, size_t); 50 extern int dmamem_unmap_anonymous(void *); 51 44 52 extern int iospace_enable(task_id_t, void *, unsigned long); 45 53 extern int pio_enable(void *, size_t, void **); 46 extern int register_irq(int, int, int, irq_code_t *); 47 extern int unregister_irq(int, int); 54 55 extern int irq_register(int, int, int, irq_code_t *); 56 extern int irq_unregister(int, int); 48 57 49 58 #endif -
uspace/lib/c/include/device/hw_res.h
rba72f2b r6843a9c 40 40 #include <bool.h> 41 41 42 #define DMA_MODE_ON_DEMAND 0 43 #define DMA_MODE_WRITE (1 << 2) 44 #define DMA_MODE_READ (1 << 3) 45 #define DMA_MODE_AUTO (1 << 4) 46 #define DMA_MODE_DOWN (1 << 5) 47 #define DMA_MODE_SINGLE (1 << 6) 48 #define DMA_MODE_BLOCK (1 << 7) 49 42 50 /** HW resource provider interface */ 43 51 typedef enum { … … 80 88 int irq; 81 89 } interrupt; 82 90 83 91 union { 84 int dma8;85 int dma16;92 unsigned int dma8; 93 unsigned int dma16; 86 94 } dma_channel; 87 95 } res; … … 106 114 extern bool hw_res_enable_interrupt(async_sess_t *); 107 115 108 #define DMA_MODE_WRITE (1 << 2) 109 #define DMA_MODE_READ (1 << 3) 110 #define DMA_MODE_AUTO (1 << 4) 111 #define DMA_MODE_DOWN (1 << 5) 112 #define DMA_MODE_SINGLE (1 << 6) 113 #define DMA_MODE_BLOCK (1 << 7) 114 #define DMA_MODE_ON_DEMAND (0) 115 116 extern int hw_res_dma_channel_setup(async_sess_t *, 117 unsigned, uint32_t, uint16_t, uint8_t); 116 extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t, 117 uint16_t, uint8_t); 118 118 119 119 #endif -
uspace/lib/c/include/device/hw_res_parsed.h
rba72f2b r6843a9c 78 78 79 79 /** Array of channels */ 80 int *channels;80 unsigned int *channels; 81 81 } dma_list_t; 82 82 … … 101 101 irq_list_t irqs; 102 102 103 /** List of DMA channels */ 104 dma_list_t dma_channels; 105 103 106 /** List of DMA channels */ 104 107 dma_list_t dma_channels; -
uspace/lib/c/include/device/nic.h
rba72f2b r6843a9c 37 37 38 38 #include <async.h> 39 #include <net/device.h> 40 #include <net/packet.h> 41 #include <ipc/services.h> 39 #include <nic/nic.h> 40 #include <ipc/common.h> 42 41 43 42 typedef enum { 44 43 NIC_SEND_MESSAGE = 0, 45 NIC_C ONNECT_TO_NIL,44 NIC_CALLBACK_CREATE, 46 45 NIC_GET_STATE, 47 46 NIC_SET_STATE, … … 85 84 } nic_funcs_t; 86 85 87 extern int nic_send_message(async_sess_t *, packet_id_t); 88 extern int nic_connect_to_nil(async_sess_t *, services_t, nic_device_id_t); 86 typedef enum { 87 NIC_EV_ADDR_CHANGED = IPC_FIRST_USER_METHOD, 88 NIC_EV_RECEIVED, 89 NIC_EV_DEVICE_STATE 90 } nic_event_t; 91 92 extern int nic_send_frame(async_sess_t *, void *, size_t); 93 extern int nic_callback_create(async_sess_t *, async_client_conn_t, void *); 89 94 extern int nic_get_state(async_sess_t *, nic_device_state_t *); 90 95 extern int nic_set_state(async_sess_t *, nic_device_state_t); … … 127 132 extern int nic_vlan_get_mask(async_sess_t *, nic_vlan_mask_t *); 128 133 extern int nic_vlan_set_mask(async_sess_t *, const nic_vlan_mask_t *); 129 extern int nic_vlan_set_tag(async_sess_t *, uint16_t, int, int);134 extern int nic_vlan_set_tag(async_sess_t *, uint16_t, bool, bool); 130 135 131 136 extern int nic_wol_virtue_add(async_sess_t *, nic_wv_type_t, const void *, -
uspace/lib/c/include/device/pci.h
rba72f2b r6843a9c 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2011 Jiri Michalec 3 3 * All rights reserved. 4 4 * … … 30 30 * @{ 31 31 */ 32 33 32 /** @file 34 * Networking subsystem central module messages.35 * @see net_interface.h36 33 */ 37 34 38 #ifndef LIBC_ NET_NET_MESSAGES_H_39 #define LIBC_ NET_NET_MESSAGES_H_35 #ifndef LIBC_DEVICE_PCI_H_ 36 #define LIBC_DEVICE_PCI_H_ 40 37 41 #include < ipc/net.h>38 #include <async.h> 42 39 43 /** Networking subsystem central module messages. */ 40 #define PCI_DEVICE_ID 0x02 41 44 42 typedef enum { 45 /** Return general configuration 46 * @see net_get_conf_req() 47 */ 48 NET_NET_GET_CONF = NET_FIRST, 49 /** Return device specific configuration 50 * @see net_get_device_conf_req() 51 */ 52 NET_NET_GET_DEVICE_CONF, 53 /** Return number of mastered devices */ 54 NET_NET_GET_DEVICES_COUNT, 55 /** Return names and device IDs of all devices */ 56 NET_NET_GET_DEVICES, 57 /** Notify the networking service about a ready device */ 58 NET_NET_DRIVER_READY 59 } net_messages; 43 IPC_M_CONFIG_SPACE_READ_8, 44 IPC_M_CONFIG_SPACE_READ_16, 45 IPC_M_CONFIG_SPACE_READ_32, 46 47 IPC_M_CONFIG_SPACE_WRITE_8, 48 IPC_M_CONFIG_SPACE_WRITE_16, 49 IPC_M_CONFIG_SPACE_WRITE_32 50 } pci_dev_iface_funcs_t; 51 52 extern int pci_config_space_read_8(async_sess_t *, uint32_t, uint8_t *); 53 extern int pci_config_space_read_16(async_sess_t *, uint32_t, uint16_t *); 54 extern int pci_config_space_read_32(async_sess_t *, uint32_t, uint32_t *); 55 56 extern int pci_config_space_write_8(async_sess_t *, uint32_t, uint8_t); 57 extern int pci_config_space_write_16(async_sess_t *, uint32_t, uint16_t); 58 extern int pci_config_space_write_32(async_sess_t *, uint32_t, uint32_t); 60 59 61 60 #endif -
uspace/lib/c/include/devman.h
rba72f2b r6843a9c 46 46 extern void devman_exchange_end(async_exch_t *); 47 47 48 extern int devman_driver_register(const char * , async_client_conn_t);48 extern int devman_driver_register(const char *); 49 49 extern int devman_add_function(const char *, fun_type_t, match_id_list_t *, 50 50 devman_handle_t, devman_handle_t *); … … 64 64 size_t *); 65 65 extern int devman_fun_get_name(devman_handle_t, char *, size_t); 66 extern int devman_fun_get_driver_name(devman_handle_t, char *, size_t); 66 67 extern int devman_fun_get_path(devman_handle_t, char *, size_t); 67 68 extern int devman_fun_online(devman_handle_t); -
uspace/lib/c/include/errno.h
rba72f2b r6843a9c 37 37 38 38 #include <abi/errno.h> 39 #include <fibril.h>40 39 41 40 #define errno (*(__errno())) … … 96 95 #define ENOTCONN (-10057) 97 96 97 #define ECONNREFUSED (-10058) 98 99 #define ECONNABORTED (-10059) 100 98 101 /** The requested operation was not performed. Try again later. */ 99 102 #define EAGAIN (-11002) -
uspace/lib/c/include/fibril.h
rba72f2b r6843a9c 41 41 42 42 #define context_set_generic(c, _pc, stack, size, ptls) \ 43 (c)->pc = (sysarg_t) (_pc); \ 44 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ 45 (c)->tls = (sysarg_t) (ptls); 43 do { \ 44 (c)->pc = (sysarg_t) (_pc); \ 45 (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ 46 (c)->tls = (sysarg_t) (ptls); \ 47 } while (0) 46 48 47 49 #define FIBRIL_SERIALIZED 1 … … 85 87 86 88 extern fid_t fibril_create(int (*func)(void *), void *arg); 89 extern void fibril_destroy(fid_t fid); 87 90 extern fibril_t *fibril_setup(void); 88 91 extern void fibril_teardown(fibril_t *f); -
uspace/lib/c/include/fibril_synch.h
rba72f2b r6843a9c 107 107 fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name) 108 108 109 typedef void (*fibril_timer_fun_t)(void *); 110 111 typedef enum { 112 /** Timer has not been set or has been cleared */ 113 fts_not_set, 114 /** Timer was set but did not fire yet */ 115 fts_active, 116 /** Timer has fired and has not been cleared since */ 117 fts_fired, 118 /** Timer is being destroyed */ 119 fts_cleanup 120 } fibril_timer_state_t; 121 122 /** Fibril timer. 123 * 124 * When a timer is set it executes a callback function (in a separate 125 * fibril) after a specified time interval. The timer can be cleared 126 * (canceled) before that. From the return value of fibril_timer_clear() 127 * one can tell whether the timer fired or not. 128 */ 129 typedef struct { 130 fibril_mutex_t lock; 131 fibril_condvar_t cv; 132 fid_t fibril; 133 fibril_timer_state_t state; 134 135 suseconds_t delay; 136 fibril_timer_fun_t fun; 137 void *arg; 138 } fibril_timer_t; 139 109 140 extern void fibril_mutex_initialize(fibril_mutex_t *); 110 141 extern void fibril_mutex_lock(fibril_mutex_t *); … … 129 160 extern void fibril_condvar_broadcast(fibril_condvar_t *); 130 161 162 extern fibril_timer_t *fibril_timer_create(void); 163 extern void fibril_timer_destroy(fibril_timer_t *); 164 extern void fibril_timer_set(fibril_timer_t *, suseconds_t, fibril_timer_fun_t, 165 void *); 166 extern fibril_timer_state_t fibril_timer_clear(fibril_timer_t *); 167 131 168 #endif 132 169 -
uspace/lib/c/include/inet/inet.h
rba72f2b r6843a9c 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2012 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup lib net29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 33 32 /** @file 34 * Hardware types according to the on-line IANA - Address Resolution Protocol35 * (ARP) Parameters36 * http://www.iana.org/assignments/arp-parameters/arp-parameters.xml,37 * cited January 14 2009.38 33 */ 39 34 40 #ifndef LIB NET_NET_HARDWARE_H_41 #define LIB NET_NET_HARDWARE_H_35 #ifndef LIBC_INET_INET_H_ 36 #define LIBC_INET_INET_H_ 42 37 43 38 #include <sys/types.h> 44 39 45 /** Network interface layer type type definition. */ 46 typedef uint8_t hw_type_t; 40 #define INET_TTL_MAX 255 47 41 48 /** @name Network interface layer types definitions */ 49 /*@{*/ 42 typedef struct { 43 uint32_t ipv4; 44 } inet_addr_t; 50 45 51 /** Ethernet (10Mb) hardware type. */ 52 #define HW_ETHER 1 46 typedef struct { 47 inet_addr_t src; 48 inet_addr_t dest; 49 uint8_t tos; 50 void *data; 51 size_t size; 52 } inet_dgram_t; 53 53 54 /*@}*/ 54 typedef struct { 55 int (*recv)(inet_dgram_t *); 56 } inet_ev_ops_t; 57 58 typedef enum { 59 INET_DF = 1 60 } inet_df_t; 61 62 extern int inet_init(uint8_t, inet_ev_ops_t *); 63 extern int inet_send(inet_dgram_t *, uint8_t, inet_df_t); 64 extern int inet_get_srcaddr(inet_addr_t *, uint8_t, inet_addr_t *); 55 65 56 66 #endif … … 58 68 /** @} 59 69 */ 60 -
uspace/lib/c/include/inet/inetping.h
rba72f2b r6843a9c 1 1 /* 2 * Copyright (c) 20 06 Josef Cejka2 * Copyright (c) 2012 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup kbd_port 30 * @ingroup kbd 29 /** @addtogroup libc 31 30 * @{ 32 31 */ 33 34 32 /** @file 35 * @brief i8042 port driver.36 33 */ 37 34 38 #ifndef i8042_H_39 #define i8042_H_35 #ifndef LIBC_INET_INETPING_H_ 36 #define LIBC_INET_INETPING_H_ 40 37 38 #include <inet/inet.h> 41 39 #include <sys/types.h> 42 #include <libarch/ddi.h>43 #include <async.h>44 40 45 /** i8042 HW I/O interface */ 46 struct i8042 { 47 i oport8_t data;48 uint 8_t pad[3];49 ioport8_t status;50 } __attribute__ ((packed));51 typedef struct i8042 i8042_t;41 typedef struct { 42 inet_addr_t src; 43 inet_addr_t dest; 44 uint16_t seq_no; 45 void *data; 46 size_t size; 47 } inetping_sdu_t; 52 48 53 /** Softstate structure, one for each serial port (primary and aux). */ 54 typedef struct { 55 service_id_t service_id; 56 async_sess_t *client_sess; 57 } i8042_port_t; 49 typedef struct inetping_ev_ops { 50 int (*recv)(inetping_sdu_t *); 51 } inetping_ev_ops_t; 52 53 extern int inetping_init(inetping_ev_ops_t *); 54 extern int inetping_send(inetping_sdu_t *); 55 extern int inetping_get_srcaddr(inet_addr_t *, inet_addr_t *); 56 58 57 59 58 #endif 60 59 61 /** 62 * @} 60 /** @} 63 61 */ -
uspace/lib/c/include/ipc/devman.h
rba72f2b r6843a9c 146 146 typedef enum { 147 147 DRIVER_DEV_ADD = IPC_FIRST_USER_METHOD, 148 DRIVER_DEV_ADDED,149 148 DRIVER_DEV_REMOVE, 150 149 DRIVER_DEV_GONE, … … 158 157 DEVMAN_FUN_GET_CHILD, 159 158 DEVMAN_FUN_GET_NAME, 159 DEVMAN_FUN_GET_DRIVER_NAME, 160 160 DEVMAN_FUN_ONLINE, 161 161 DEVMAN_FUN_OFFLINE, -
uspace/lib/c/include/ipc/inet.h
rba72f2b r6843a9c 1 1 /* 2 * Copyright (c) 2009 Lukas Mejdrech 3 * Copyright (c) 2011 Radim Vansa 2 * Copyright (c) 2012 Jiri Svoboda 4 3 * All rights reserved. 5 4 * … … 28 27 */ 29 28 30 /** @addtogroup lib packet29 /** @addtogroup libcipc 31 30 * @{ 32 31 */ 33 34 32 /** @file 35 * Packet server.36 * The hosting module has to be compiled with both the packet.c and the37 * packet_server.c source files. To function correctly, initialization of the38 * packet map by the pm_init() function has to happen at the first place. Then39 * the packet messages have to be processed by the packet_server_message()40 * function. The packet map should be released by the pm_destroy() function41 * during the module termination.42 * @see IS_NET_PACKET_MESSAGE()43 33 */ 44 34 45 #ifndef NET_PACKET_SERVER_H_46 #define NET_PACKET_SERVER_H_35 #ifndef LIBC_IPC_INET_H_ 36 #define LIBC_IPC_INET_H_ 47 37 48 38 #include <ipc/common.h> 49 39 50 extern int packet_server_init(void); 51 extern int packet_server_message(ipc_callid_t, ipc_call_t *, ipc_call_t *, 52 size_t *); 40 /** Inet ports */ 41 typedef enum { 42 /** Default port */ 43 INET_PORT_DEFAULT = 1, 44 /** Configuration port */ 45 INET_PORT_CFG, 46 /** Ping service port */ 47 INET_PORT_PING 48 } inet_port_t; 49 50 /** Requests on Inet default port */ 51 typedef enum { 52 INET_CALLBACK_CREATE = IPC_FIRST_USER_METHOD, 53 INET_GET_SRCADDR, 54 INET_SEND, 55 INET_SET_PROTO 56 } inet_request_t; 57 58 /** Events on Inet default port */ 59 typedef enum { 60 INET_EV_RECV = IPC_FIRST_USER_METHOD 61 } inet_event_t; 62 63 /** Requests on Inet configuration port */ 64 typedef enum { 65 INETCFG_ADDR_CREATE_STATIC = IPC_FIRST_USER_METHOD, 66 INETCFG_ADDR_DELETE, 67 INETCFG_ADDR_GET, 68 INETCFG_ADDR_GET_ID, 69 INETCFG_GET_ADDR_LIST, 70 INETCFG_GET_LINK_LIST, 71 INETCFG_GET_SROUTE_LIST, 72 INETCFG_LINK_GET, 73 INETCFG_SROUTE_CREATE, 74 INETCFG_SROUTE_DELETE, 75 INETCFG_SROUTE_GET, 76 INETCFG_SROUTE_GET_ID 77 } inetcfg_request_t; 78 79 /** Events on Inet ping port */ 80 typedef enum { 81 INETPING_EV_RECV = IPC_FIRST_USER_METHOD 82 } inetping_event_t; 83 84 /** Requests on Inet ping port */ 85 typedef enum { 86 INETPING_SEND = IPC_FIRST_USER_METHOD, 87 INETPING_GET_SRCADDR 88 } inetping_request_t; 53 89 54 90 #endif 55 91 56 /** @} 92 /** 93 * @} 57 94 */ -
uspace/lib/c/include/ipc/ipc.h
rba72f2b r6843a9c 254 254 sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool); 255 255 256 extern int ipc_clone_establish(int); 256 257 extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, task_id_t *, 257 258 sysarg_t *); 258 extern int ipc_connect_me(int);259 259 extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t); 260 260 extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t); … … 271 271 */ 272 272 273 #define ipc_share_in_start_0_0(phoneid, dst, size) \274 ipc_share_in_start((phoneid), ( dst), (size), 0, NULL)275 #define ipc_share_in_start_0_1(phoneid, dst, size, flags) \276 ipc_share_in_start((phoneid), ( dst), (size), 0, (flags))277 #define ipc_share_in_start_1_0(phoneid, dst, size, arg) \278 ipc_share_in_start((phoneid), ( dst), (size), (arg), NULL)279 #define ipc_share_in_start_1_1(phoneid, dst, size, arg, flags) \280 ipc_share_in_start((phoneid), ( dst), (size), (arg), (flags))281 282 extern int ipc_share_in_start(int, void *, size_t, sysarg_t, unsigned int*);273 #define ipc_share_in_start_0_0(phoneid, size, dst) \ 274 ipc_share_in_start((phoneid), (size), 0, NULL, (dst)) 275 #define ipc_share_in_start_0_1(phoneid, size, flags, dst) \ 276 ipc_share_in_start((phoneid), (size), 0, (flags), (dst)) 277 #define ipc_share_in_start_1_0(phoneid, size, arg, dst) \ 278 ipc_share_in_start((phoneid), (size), (arg), NULL, (dst)) 279 #define ipc_share_in_start_1_1(phoneid, size, arg, flags, dst) \ 280 ipc_share_in_start((phoneid), (size), (arg), (flags), (dst)) 281 282 extern int ipc_share_in_start(int, size_t, sysarg_t, unsigned int *, void **); 283 283 extern int ipc_share_in_finalize(ipc_callid_t, void *, unsigned int); 284 284 extern int ipc_share_out_start(int, void *, unsigned int); 285 extern int ipc_share_out_finalize(ipc_callid_t, void * );285 extern int ipc_share_out_finalize(ipc_callid_t, void **); 286 286 extern int ipc_data_read_start(int, void *, size_t); 287 287 extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t); -
uspace/lib/c/include/ipc/loc.h
rba72f2b r6843a9c 56 56 LOC_SERVICE_GET_ID, 57 57 LOC_SERVICE_GET_NAME, 58 LOC_SERVICE_GET_SERVER_NAME, 58 59 LOC_NAMESPACE_GET_ID, 59 60 LOC_CALLBACK_CREATE, -
uspace/lib/c/include/ipc/services.h
rba72f2b r6843a9c 48 48 SERVICE_IRC = FOURCC('i', 'r', 'c', ' '), 49 49 SERVICE_CLIPBOARD = FOURCC('c', 'l', 'i', 'p'), 50 SERVICE_NETWORKING = FOURCC('n', 'e', 't', ' '),51 SERVICE_ETHERNET = FOURCC('e', 't', 'h', ' '),52 SERVICE_NILDUMMY = FOURCC('n', 'i', 'l', 'd'),53 SERVICE_IP = FOURCC('i', 'p', 'v', '4'),54 SERVICE_ARP = FOURCC('a', 'r', 'p', ' '),55 SERVICE_ICMP = FOURCC('i', 'c', 'm', 'p'),56 50 SERVICE_UDP = FOURCC('u', 'd', 'p', ' '), 57 51 SERVICE_TCP = FOURCC('t', 'c', 'p', ' ') 58 52 } services_t; 53 54 #define SERVICE_NAME_INET "net/inet" 55 #define SERVICE_NAME_INETCFG "net/inetcfg" 56 #define SERVICE_NAME_INETPING "net/inetping" 59 57 60 58 #endif -
uspace/lib/c/include/ipc/socket.h
rba72f2b r6843a9c 38 38 #define LIBC_SOCKET_MESSAGES_H_ 39 39 40 #include <ipc/net.h>41 42 40 /** Socket client messages. */ 43 41 typedef enum { 44 42 /** Creates a new socket. @see socket() */ 45 NET_SOCKET = NET_SOCKET_FIRST,43 NET_SOCKET = IPC_FIRST_USER_METHOD, 46 44 /** Binds the socket. @see bind() */ 47 45 NET_SOCKET_BIND, -
uspace/lib/c/include/ipc/vfs.h
rba72f2b r6843a9c 42 42 #define FS_NAME_MAXLEN 20 43 43 #define MAX_PATH_LEN (64 * 1024) 44 #define MAX_MNTOPTS_LEN 256 44 45 #define PLB_SIZE (2 * MAX_PATH_LEN) 45 46 … … 80 81 VFS_IN_DUP, 81 82 VFS_IN_WAIT_HANDLE, 83 VFS_IN_MTAB_GET, 82 84 } vfs_in_request_t; 83 85 -
uspace/lib/c/include/loc.h
rba72f2b r6843a9c 46 46 extern void loc_exchange_end(async_exch_t *); 47 47 48 extern int loc_server_register(const char * , async_client_conn_t);48 extern int loc_server_register(const char *); 49 49 extern int loc_service_register(const char *, service_id_t *); 50 50 extern int loc_service_register_with_iface(const char *, service_id_t *, … … 56 56 unsigned int); 57 57 extern int loc_service_get_name(service_id_t, char **); 58 extern int loc_service_get_server_name(service_id_t, char **); 58 59 extern int loc_namespace_get_id(const char *, service_id_t *, 59 60 unsigned int); -
uspace/lib/c/include/net/device.h
rba72f2b r6843a9c 1 1 /* 2 2 * Copyright (c) 2009 Lukas Mejdrech 3 * Copyright (c) 2011 Radim Vansa4 3 * All rights reserved. 5 4 * … … 33 32 34 33 /** @file 35 * Device identifier, state and usage statistics.34 * Network device. 36 35 */ 37 36 38 #ifndef LIBC_ DEVICE_ID_TYPE_H_39 #define LIBC_ DEVICE_ID_TYPE_H_37 #ifndef LIBC_NET_DEVICE_H_ 38 #define LIBC_NET_DEVICE_H_ 40 39 41 40 #include <adt/int_map.h> 42 #include <net/eth_phys.h> 43 #include <bool.h> 44 45 /** Ethernet address length. */ 46 #define ETH_ADDR 6 47 48 /** MAC printing format */ 49 #define PRIMAC "%02x:%02x:%02x:%02x:%02x:%02x" 50 51 /** MAC arguments */ 52 #define ARGSMAC(__a) \ 53 (__a)[0], (__a)[1], (__a)[2], (__a)[3], (__a)[4], (__a)[5] 54 55 /* Compare MAC address with specific value */ 56 #define MAC_EQUALS_VALUE(__a, __a0, __a1, __a2, __a3, __a4, __a5) \ 57 ((__a)[0] == (__a0) && (__a)[1] == (__a1) && (__a)[2] == (__a2) \ 58 && (__a)[3] == (__a3) && (__a)[4] == (__a4) && (__a)[5] == (__a5)) 59 60 #define MAC_IS_ZERO(__x) \ 61 MAC_EQUALS_VALUE(__x, 0, 0, 0, 0, 0, 0) 41 #include <nic/nic.h> 62 42 63 43 /** Device identifier to generic type map declaration. */ … … 67 47 #define DEVICE_MAP_IMPLEMENT INT_MAP_IMPLEMENT 68 48 69 /** Max length of any hw nic address (currently only eth)*/70 #define NIC_MAX_ADDRESS_LENGTH 16 49 /** Device identifier type. */ 50 typedef int nic_device_id_t; 71 51 72 52 /** Invalid device identifier. */ 73 53 #define NIC_DEVICE_INVALID_ID (-1) 74 75 #define NIC_VENDOR_MAX_LENGTH 6476 #define NIC_MODEL_MAX_LENGTH 6477 #define NIC_PART_NUMBER_MAX_LENGTH 6478 #define NIC_SERIAL_NUMBER_MAX_LENGTH 6479 80 /**81 * The bitmap uses single bit for each of the 2^12 = 4096 possible VLAN tags.82 * This means its size is 4096/8 = 512 bytes.83 */84 #define NIC_VLAN_BITMAP_SIZE 51285 86 #define NIC_DEVICE_PRINT_FMT "%x"87 88 /** Device identifier type. */89 typedef int nic_device_id_t;90 91 /**92 * Structure covering the MAC address.93 */94 typedef struct nic_address {95 uint8_t address[ETH_ADDR];96 } nic_address_t;97 98 /** Device state. */99 typedef enum nic_device_state {100 /**101 * Device present and stopped. Moving device to this state means to discard102 * all settings and WOL virtues, rebooting the NIC to state as if the103 * computer just booted (or the NIC was just inserted in case of removable104 * NIC).105 */106 NIC_STATE_STOPPED,107 /**108 * If the NIC is in this state no packets (frames) are transmitted nor109 * received. However, the settings are not restarted. You can use this state110 * to temporarily disable transmition/reception or atomically (with respect111 * to incoming/outcoming packets) change frames acceptance etc.112 */113 NIC_STATE_DOWN,114 /** Device is normally operating. */115 NIC_STATE_ACTIVE,116 /** Just a constant to limit the state numbers */117 NIC_STATE_MAX,118 } nic_device_state_t;119 120 /**121 * Channel operating mode used on the medium.122 */123 typedef enum {124 NIC_CM_UNKNOWN,125 NIC_CM_FULL_DUPLEX,126 NIC_CM_HALF_DUPLEX,127 NIC_CM_SIMPLEX128 } nic_channel_mode_t;129 130 /**131 * Role for the device (used e.g. for 1000Gb ethernet)132 */133 typedef enum {134 NIC_ROLE_UNKNOWN,135 NIC_ROLE_AUTO,136 NIC_ROLE_MASTER,137 NIC_ROLE_SLAVE138 } nic_role_t;139 140 /**141 * Current state of the cable in the device142 */143 typedef enum {144 NIC_CS_UNKNOWN,145 NIC_CS_PLUGGED,146 NIC_CS_UNPLUGGED147 } nic_cable_state_t;148 149 /**150 * Result of the requested operation151 */152 typedef enum {153 /** Successfully disabled */154 NIC_RESULT_DISABLED,155 /** Successfully enabled */156 NIC_RESULT_ENABLED,157 /** Not supported at all */158 NIC_RESULT_NOT_SUPPORTED,159 /** Temporarily not available */160 NIC_RESULT_NOT_AVAILABLE,161 /** Result extensions */162 NIC_RESULT_FIRST_EXTENSION163 } nic_result_t;164 165 /** Device usage statistics. */166 typedef struct nic_device_stats {167 /** Total packets received (accepted). */168 unsigned long receive_packets;169 /** Total packets transmitted. */170 unsigned long send_packets;171 /** Total bytes received (accepted). */172 unsigned long receive_bytes;173 /** Total bytes transmitted. */174 unsigned long send_bytes;175 /** Bad packets received counter. */176 unsigned long receive_errors;177 /** Packet transmition problems counter. */178 unsigned long send_errors;179 /** Number of frames dropped due to insufficient space in RX buffers */180 unsigned long receive_dropped;181 /** Number of frames dropped due to insufficient space in TX buffers */182 unsigned long send_dropped;183 /** Total multicast packets received (accepted). */184 unsigned long receive_multicast;185 /** Total broadcast packets received (accepted). */186 unsigned long receive_broadcast;187 /** The number of collisions due to congestion on the medium. */188 unsigned long collisions;189 /** Unicast packets received but not accepted (filtered) */190 unsigned long receive_filtered_unicast;191 /** Multicast packets received but not accepted (filtered) */192 unsigned long receive_filtered_multicast;193 /** Broadcast packets received but not accepted (filtered) */194 unsigned long receive_filtered_broadcast;195 196 /* detailed receive_errors */197 198 /** Received packet length error counter. */199 unsigned long receive_length_errors;200 /** Receiver buffer overflow counter. */201 unsigned long receive_over_errors;202 /** Received packet with crc error counter. */203 unsigned long receive_crc_errors;204 /** Received frame alignment error counter. */205 unsigned long receive_frame_errors;206 /** Receiver fifo overrun counter. */207 unsigned long receive_fifo_errors;208 /** Receiver missed packet counter. */209 unsigned long receive_missed_errors;210 211 /* detailed send_errors */212 213 /** Transmitter aborted counter. */214 unsigned long send_aborted_errors;215 /** Transmitter carrier errors counter. */216 unsigned long send_carrier_errors;217 /** Transmitter fifo overrun counter. */218 unsigned long send_fifo_errors;219 /** Transmitter carrier errors counter. */220 unsigned long send_heartbeat_errors;221 /** Transmitter window errors counter. */222 unsigned long send_window_errors;223 224 /* for cslip etc */225 226 /** Total compressed packets received. */227 unsigned long receive_compressed;228 /** Total compressed packet transmitted. */229 unsigned long send_compressed;230 } nic_device_stats_t;231 232 /** Errors corresponding to those in the nic_device_stats_t */233 typedef enum {234 NIC_SEC_BUFFER_FULL,235 NIC_SEC_ABORTED,236 NIC_SEC_CARRIER_LOST,237 NIC_SEC_FIFO_OVERRUN,238 NIC_SEC_HEARTBEAT,239 NIC_SEC_WINDOW_ERROR,240 /* Error encountered during TX but with other type of error */241 NIC_SEC_OTHER242 } nic_send_error_cause_t;243 244 /** Errors corresponding to those in the nic_device_stats_t */245 typedef enum {246 NIC_REC_BUFFER_FULL,247 NIC_REC_LENGTH,248 NIC_REC_BUFFER_OVERFLOW,249 NIC_REC_CRC,250 NIC_REC_FRAME_ALIGNMENT,251 NIC_REC_FIFO_OVERRUN,252 NIC_REC_MISSED,253 /* Error encountered during RX but with other type of error */254 NIC_REC_OTHER255 } nic_receive_error_cause_t;256 257 /**258 * Information about the NIC that never changes - name, vendor, model,259 * capabilites and so on.260 */261 typedef struct nic_device_info {262 /* Device identification */263 char vendor_name[NIC_VENDOR_MAX_LENGTH];264 char model_name[NIC_MODEL_MAX_LENGTH];265 char part_number[NIC_PART_NUMBER_MAX_LENGTH];266 char serial_number[NIC_SERIAL_NUMBER_MAX_LENGTH];267 uint16_t vendor_id;268 uint16_t device_id;269 uint16_t subsystem_vendor_id;270 uint16_t subsystem_id;271 /* Device capabilities */272 uint16_t ethernet_support[ETH_PHYS_LAYERS];273 274 /** The mask of all modes which the device can advertise275 *276 * see ETH_AUTONEG_ macros in net/eth_phys.h of libc277 */278 uint32_t autoneg_support;279 } nic_device_info_t;280 281 /**282 * Type of the ethernet frame283 */284 typedef enum nic_frame_type {285 NIC_FRAME_UNICAST,286 NIC_FRAME_MULTICAST,287 NIC_FRAME_BROADCAST288 } nic_frame_type_t;289 290 /**291 * Specifies which unicast frames is the NIC receiving.292 */293 typedef enum nic_unicast_mode {294 NIC_UNICAST_UNKNOWN,295 /** No unicast frames are received */296 NIC_UNICAST_BLOCKED,297 /** Only the frames with this NIC's MAC as destination are received */298 NIC_UNICAST_DEFAULT,299 /**300 * Both frames with this NIC's MAC and those specified in the list are301 * received302 */303 NIC_UNICAST_LIST,304 /** All unicast frames are received */305 NIC_UNICAST_PROMISC306 } nic_unicast_mode_t;307 308 typedef enum nic_multicast_mode {309 NIC_MULTICAST_UNKNOWN,310 /** No multicast frames are received */311 NIC_MULTICAST_BLOCKED,312 /** Frames with multicast addresses specified in this list are received */313 NIC_MULTICAST_LIST,314 /** All multicast frames are received */315 NIC_MULTICAST_PROMISC316 } nic_multicast_mode_t;317 318 typedef enum nic_broadcast_mode {319 NIC_BROADCAST_UNKNOWN,320 /** Broadcast frames are dropped */321 NIC_BROADCAST_BLOCKED,322 /** Broadcast frames are received */323 NIC_BROADCAST_ACCEPTED324 } nic_broadcast_mode_t;325 326 /**327 * Structure covering the bitmap with VLAN tags.328 */329 typedef struct nic_vlan_mask {330 uint8_t bitmap[NIC_VLAN_BITMAP_SIZE];331 } nic_vlan_mask_t;332 333 /* WOL virtue identifier */334 typedef unsigned int nic_wv_id_t;335 336 /**337 * Structure passed as argument for virtue NIC_WV_MAGIC_PACKET.338 */339 typedef struct nic_wv_magic_packet_data {340 uint8_t password[6];341 } nic_wv_magic_packet_data_t;342 343 /**344 * Structure passed as argument for virtue NIC_WV_DIRECTED_IPV4345 */346 typedef struct nic_wv_ipv4_data {347 uint8_t address[4];348 } nic_wv_ipv4_data_t;349 350 /**351 * Structure passed as argument for virtue NIC_WV_DIRECTED_IPV6352 */353 typedef struct nic_wv_ipv6_data {354 uint8_t address[16];355 } nic_wv_ipv6_data_t;356 357 /**358 * WOL virtue types defining the interpretation of data passed to the virtue.359 * Those tagged with S can have only single virtue active at one moment, those360 * tagged with M can have multiple ones.361 */362 typedef enum nic_wv_type {363 /**364 * Used for deletion of the virtue - in this case the mask, data and length365 * arguments are ignored.366 */367 NIC_WV_NONE,368 /** S369 * Enabled <=> wakeup upon link change370 */371 NIC_WV_LINK_CHANGE,372 /** S373 * If this virtue is set up, wakeup can be issued by a magic packet frame.374 * If the data argument is not NULL, it must contain375 * nic_wv_magic_packet_data structure with the SecureOn password.376 */377 NIC_WV_MAGIC_PACKET,378 /** M379 * If the virtue is set up, wakeup can be issued by a frame targeted to380 * device with MAC address specified in data. The data must contain381 * nic_address_t structure.382 */383 NIC_WV_DESTINATION,384 /** S385 * Enabled <=> wakeup upon receiving broadcast frame386 */387 NIC_WV_BROADCAST,388 /** S389 * Enabled <=> wakeup upon receiving ARP Request390 */391 NIC_WV_ARP_REQUEST,392 /** M393 * If enabled, the wakeup is issued upon receiving frame with an IPv4 packet394 * with IPv4 address specified in data. The data must contain395 * nic_wv_ipv4_data structure.396 */397 NIC_WV_DIRECTED_IPV4,398 /** M399 * If enabled, the wakeup is issued upon receiving frame with an IPv4 packet400 * with IPv6 address specified in data. The data must contain401 * nic_wv_ipv6_data structure.402 */403 NIC_WV_DIRECTED_IPV6,404 /** M405 * First length/2 bytes in the argument are interpreted as mask, second406 * length/2 bytes are interpreted as content.407 * If enabled, the wakeup is issued upon receiving frame where the bytes408 * with non-zero value in the mask equal to those in the content.409 */410 NIC_WV_FULL_MATCH,411 /**412 * Dummy value, do not use.413 */414 NIC_WV_MAX415 } nic_wv_type_t;416 417 /**418 * Specifies the interrupt/polling mode used by the driver and NIC419 */420 typedef enum nic_poll_mode {421 /**422 * NIC issues interrupts upon events.423 */424 NIC_POLL_IMMEDIATE,425 /**426 * Some uspace app calls nic_poll_now(...) in order to check the NIC state427 * - no interrupts are received from the NIC.428 */429 NIC_POLL_ON_DEMAND,430 /**431 * The driver itself issues a poll request in a periodic manner. It is432 * allowed to use hardware timer if the NIC supports it.433 */434 NIC_POLL_PERIODIC,435 /**436 * The driver itself issued a poll request in a periodic manner. The driver437 * must create software timer, internal hardware timer of NIC must not be438 * used even if the NIC supports it.439 */440 NIC_POLL_SOFTWARE_PERIODIC441 } nic_poll_mode_t;442 443 /**444 * Says if this virtue type is a multi-virtue (there can be multiple virtues of445 * this type at once).446 *447 * @param type448 *449 * @return true or false450 */451 static inline int nic_wv_is_multi(nic_wv_type_t type) {452 switch (type) {453 case NIC_WV_FULL_MATCH:454 case NIC_WV_DESTINATION:455 case NIC_WV_DIRECTED_IPV4:456 case NIC_WV_DIRECTED_IPV6:457 return true;458 default:459 return false;460 }461 }462 463 static inline const char *nic_device_state_to_string(nic_device_state_t state)464 {465 switch (state) {466 case NIC_STATE_STOPPED:467 return "stopped";468 case NIC_STATE_DOWN:469 return "down";470 case NIC_STATE_ACTIVE:471 return "active";472 default:473 return "undefined";474 }475 }476 54 477 55 #endif -
uspace/lib/c/include/net/in.h
rba72f2b r6843a9c 45 45 #define INET_ADDRSTRLEN (4 * 3 + 3 + 1) 46 46 47 #define INADDR_ANY 0 48 47 49 /** Type definition of the INET address. 48 50 * @see in_addr -
uspace/lib/c/include/nic/eth_phys.h
rba72f2b r6843a9c 28 28 */ 29 29 30 #ifndef LIBC_N ET_ETH_PHYS_H_31 #define LIBC_N ET_ETH_PHYS_H_30 #ifndef LIBC_NIC_ETH_PHYS_H_ 31 #define LIBC_NIC_ETH_PHYS_H_ 32 32 33 33 #include <sys/types.h> -
uspace/lib/c/include/ns.h
rba72f2b r6843a9c 37 37 38 38 #include <sys/types.h> 39 #include <ipc/services.h> 39 40 #include <task.h> 40 41 #include <async.h> 41 42 42 43 extern int service_register(sysarg_t); 43 extern async_sess_t *service_connect(exch_mgmt_t, s ysarg_t, sysarg_t, sysarg_t);44 extern async_sess_t *service_connect_blocking(exch_mgmt_t, s ysarg_t, sysarg_t,44 extern async_sess_t *service_connect(exch_mgmt_t, services_t, sysarg_t, sysarg_t); 45 extern async_sess_t *service_connect_blocking(exch_mgmt_t, services_t, sysarg_t, 45 46 sysarg_t); 47 extern async_sess_t *service_bind(services_t, sysarg_t, sysarg_t, sysarg_t, 48 async_client_conn_t); 46 49 47 50 extern int ns_ping(void); -
uspace/lib/c/include/stdarg.h
rba72f2b r6843a9c 43 43 #define va_arg(ap, type) __builtin_va_arg(ap, type) 44 44 #define va_end(ap) __builtin_va_end(ap) 45 #define va_copy(dst, src) __builtin_va_copy(dst, src) 45 46 46 47 #endif -
uspace/lib/c/include/stdio.h
rba72f2b r6843a9c 39 39 #include <stdarg.h> 40 40 #include <str.h> 41 #include <adt/list.h>42 41 43 42 #ifndef NVERIFY_PRINTF -
uspace/lib/c/include/str.h
rba72f2b r6843a9c 61 61 extern size_t wstr_size(const wchar_t *str); 62 62 63 extern size_t str_nsize(const char *str, size_t max_size); 64 extern size_t wstr_nsize(const wchar_t *str, size_t max_size); 65 63 66 extern size_t str_lsize(const char *str, size_t max_len); 64 67 extern size_t wstr_lsize(const wchar_t *str, size_t max_len); … … 91 94 extern char *str_rchr(const char *str, wchar_t ch); 92 95 96 extern void str_rtrim(char *str, wchar_t ch); 97 extern void str_ltrim(char *str, wchar_t ch); 98 93 99 extern bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos); 94 100 extern bool wstr_remove(wchar_t *str, size_t pos); … … 100 106 extern int str_uint16_t(const char *, char **, unsigned int, bool, uint16_t *); 101 107 extern int str_uint32_t(const char *, char **, unsigned int, bool, uint32_t *); 102 extern int str_uint64 (const char *, char **, unsigned int, bool, uint64_t *);108 extern int str_uint64_t(const char *, char **, unsigned int, bool, uint64_t *); 103 109 extern int str_size_t(const char *, char **, unsigned int, bool, size_t *); 104 110 -
uspace/lib/c/include/sys/mman.h
rba72f2b r6843a9c 39 39 #include <sys/types.h> 40 40 41 #define MAP_FAILED ((void *) -1)41 #define MAP_FAILED AS_MAP_FAILED 42 42 43 43 #define MAP_SHARED (1 << 0) -
uspace/lib/c/include/sysinfo.h
rba72f2b r6843a9c 40 40 #include <abi/sysinfo.h> 41 41 42 extern char *sysinfo_get_keys(const char *, size_t *); 42 43 extern sysinfo_item_val_type_t sysinfo_get_val_type(const char *); 43 44 extern int sysinfo_get_value(const char *, sysarg_t *); 44 45 extern void *sysinfo_get_data(const char *, size_t *); 46 extern void *sysinfo_get_property(const char *, const char *, size_t *); 45 47 46 48 #endif -
uspace/lib/c/include/unistd.h
rba72f2b r6843a9c 58 58 #define getpagesize() (PAGE_SIZE) 59 59 60 extern int dup2(int oldfd, int newfd);60 extern int dup2(int, int); 61 61 62 62 extern ssize_t write(int, const void *, size_t); … … 73 73 extern int unlink(const char *); 74 74 75 extern char *getcwd(char * buf, size_t);75 extern char *getcwd(char *, size_t); 76 76 extern int rmdir(const char *); 77 77 extern int chdir(const char *); -
uspace/lib/c/include/vfs/vfs.h
rba72f2b r6843a9c 39 39 #include <ipc/vfs.h> 40 40 #include <ipc/loc.h> 41 #include <adt/list.h> 41 42 #include <stdio.h> 42 43 #include <async.h> 44 #include "vfs_mtab.h" 43 45 44 46 enum vfs_change_state_type { … … 55 57 56 58 extern int fd_wait(void); 59 extern int get_mtab_list(list_t *mtab_list); 57 60 58 61 extern async_exch_t *vfs_exchange_begin(void); -
uspace/lib/c/include/vfs/vfs_mtab.h
rba72f2b r6843a9c 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2011 Maurizio Lombardi 3 3 * All rights reserved. 4 4 * … … 30 30 * @{ 31 31 */ 32 33 32 /** @file 34 * Transport layer modules messages.35 * @see tl_interface.h36 33 */ 37 34 38 #ifndef LIBC_ TL_MESSAGES_H_39 #define LIBC_ TL_MESSAGES_H_35 #ifndef LIBC_VFS_MTAB_H_ 36 #define LIBC_VFS_MTAB_H_ 40 37 41 #include <ipc/net.h> 38 #include <sys/types.h> 39 #include <ipc/vfs.h> 40 #include <adt/list.h> 42 41 43 /** Transport layer modules messages. */ 44 typedef enum { 45 /** Packet received message. 46 * @see tl_received_msg() 47 */ 48 NET_TL_RECEIVED = NET_TL_FIRST 49 } tl_messages; 42 typedef struct mtab_ent { 43 link_t link; 44 char mp[MAX_PATH_LEN]; 45 char opts[MAX_MNTOPTS_LEN]; 46 char fs_name[FS_NAME_MAXLEN]; 47 unsigned int instance; 48 service_id_t service_id; 49 } mtab_ent_t; 50 50 51 51 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
