|
|
1.1 root 1: /******************************************************************************
2: * Copyright (c) 2004, 2008 IBM Corporation
3: * All rights reserved.
4: * This program and the accompanying materials
5: * are made available under the terms of the BSD License
6: * which accompanies this distribution, and is available at
7: * http://www.opensource.org/licenses/bsd-license.php
8: *
9: * Contributors:
10: * IBM Corporation - initial implementation
11: *****************************************************************************/
12:
13:
14: #ifndef _SOCKET_H
15: #define _SOCKET_H
16: #include <stdint.h>
17:
18: #include "systemcall.h"
19:
20: #define AF_PACKET 0
21: #define AF_INET 1
22: #define AF_INET6 2
23:
24: #define SOCK_RAW 0
25: #define SOCK_PACKET 1
26: #define SOCK_DGRAM 2
27: #define SOCK_STREAM 3
28:
29: #define INADDR_ANY 0xFFFFFFFF
30:
31: #define IPPROTO_UDP 1
32:
33: #define ETH_ALEN 6 /**< HW address length */
34:
35: struct sockaddr {
36: uint16_t tra_port;
37:
38: uint16_t ipv4_proto;
39: uint32_t ipv4_addr;
40:
41: // protocol field is only used by "connect"-handler
42: uint16_t llc_proto;
43: uint8_t mac_addr[ETH_ALEN];
44: };
45:
46: int socket(int, int, int, char *);
47: int sendto(int, const void *, int, int, const void *, int);
48: int send(int, void *, int, int);
49: int recv(int, void *, int, int);
50:
51: #define htonl(x) x
52: #define htons(x) x
53:
54: #endif
55:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.