Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __UM_SLIRP_H |
| 2 | #define __UM_SLIRP_H |
| 3 | |
| 4 | #define BUF_SIZE 1500 |
| 5 | /* two bytes each for a (pathological) max packet of escaped chars + * |
| 6 | * terminating END char + initial END char */ |
| 7 | #define ENC_BUF_SIZE (2 * BUF_SIZE + 2) |
| 8 | |
| 9 | #define SLIRP_MAX_ARGS 100 |
| 10 | /* |
| 11 | * XXX this next definition is here because I don't understand why this |
| 12 | * initializer doesn't work in slirp_kern.c: |
| 13 | * |
| 14 | * argv : { init->argv[ 0 ... SLIRP_MAX_ARGS-1 ] }, |
| 15 | * |
| 16 | * or why I can't typecast like this: |
| 17 | * |
| 18 | * argv : (char* [SLIRP_MAX_ARGS])(init->argv), |
| 19 | */ |
| 20 | struct arg_list_dummy_wrapper { char *argv[SLIRP_MAX_ARGS]; }; |
| 21 | |
| 22 | struct slirp_data { |
| 23 | void *dev; |
| 24 | struct arg_list_dummy_wrapper argw; |
| 25 | int pid; |
| 26 | int slave; |
| 27 | char ibuf[ENC_BUF_SIZE]; |
| 28 | char obuf[ENC_BUF_SIZE]; |
| 29 | int more; /* more data: do not read fd until ibuf has been drained */ |
| 30 | int pos; |
| 31 | int esc; |
| 32 | }; |
| 33 | |
| 34 | extern struct net_user_info slirp_user_info; |
| 35 | |
| 36 | extern int set_umn_addr(int fd, char *addr, char *ptp_addr); |
| 37 | extern int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri); |
| 38 | extern int slirp_user_write(int fd, void *buf, int len, struct slirp_data *pri); |
| 39 | |
| 40 | #endif |
| 41 | |
| 42 | /* |
| 43 | * Overrides for Emacs so that we follow Linus's tabbing style. |
| 44 | * Emacs will notice this stuff at the end of the file and automatically |
| 45 | * adjust the settings for this buffer only. This must remain at the end |
| 46 | * of the file. |
| 47 | * --------------------------------------------------------------------------- |
| 48 | * Local variables: |
| 49 | * c-file-style: "linux" |
| 50 | * End: |
| 51 | */ |