adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2002, Adam Dunkels. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above |
| 11 | * copyright notice, this list of conditions and the following |
| 12 | * disclaimer in the documentation and/or other materials provided |
| 13 | * with the distribution. |
adamdunkels | 06f897e | 2004-06-06 05:59:20 +0000 | [diff] [blame] | 14 | * 3. The name of the author may not be used to endorse or promote |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 15 | * products derived from this software without specific prior |
| 16 | * written permission. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS |
| 19 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
| 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 24 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 26 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 27 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | * |
| 30 | * This file is part of the "contiki" web browser. |
| 31 | * |
adamdunkels | 46cd143 | 2004-07-04 17:50:39 +0000 | [diff] [blame] | 32 | * $Id: webclient.h,v 1.6 2004/07/04 17:50:39 adamdunkels Exp $ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 33 | * |
| 34 | */ |
| 35 | #ifndef __WEBCLIENT_H__ |
| 36 | #define __WEBCLIENT_H__ |
| 37 | |
| 38 | |
| 39 | #include "http-strings.h" |
adamdunkels | 09c3c76 | 2003-07-31 23:32:04 +0000 | [diff] [blame] | 40 | #include "http-user-agent-string.h" |
adamdunkels | 86c5f21 | 2003-11-27 15:47:24 +0000 | [diff] [blame] | 41 | #include "resolv.h" |
adamdunkels | 46cd143 | 2004-07-04 17:50:39 +0000 | [diff] [blame] | 42 | |
adamdunkels | 2e41542 | 2003-04-10 09:04:49 +0000 | [diff] [blame] | 43 | |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 44 | /* Callback functions that have to be implemented by the application |
| 45 | program. */ |
| 46 | struct webclient_state; |
| 47 | void webclient_datahandler(char *data, u16_t len); |
| 48 | void webclient_connected(void); |
| 49 | void webclient_timedout(void); |
| 50 | void webclient_aborted(void); |
| 51 | void webclient_closed(void); |
| 52 | |
| 53 | |
| 54 | /* Functions. */ |
| 55 | void webclient_init(void); |
| 56 | unsigned char webclient_get(char *host, u16_t port, char *file); |
| 57 | void webclient_close(void); |
adamdunkels | 46cd143 | 2004-07-04 17:50:39 +0000 | [diff] [blame] | 58 | |
| 59 | void webclient_appcall(void *state); |
| 60 | /*DISPATCHER_UIPCALL(webclient_appcall, state);*/ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 61 | |
| 62 | char *webclient_mimetype(void); |
| 63 | char *webclient_filename(void); |
| 64 | char *webclient_hostname(void); |
| 65 | unsigned short webclient_port(void); |
| 66 | |
| 67 | #endif /* __WEBCLIENT_H__ */ |