wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
upnp_xml.h File Reference

UPnP XML helper routines Copyright (c) 2006-2007 Sony Corporation Copyright (c) 2008-2009 Atheros Communications Copyright (c) 2009, Jouni Malinen j@w1..nosp@m.fi More...

#include "http.h"

Go to the source code of this file.

Functions

void xml_data_encode (struct wpabuf *buf, const char *data, int len)
 
void xml_add_tagged_data (struct wpabuf *buf, const char *tag, const char *data)
 
int xml_next_tag (const char *in, const char **out, const char **out_tagname, const char **end)
 Advance to next tag. More...
 
char * xml_get_first_item (const char *doc, const char *item)
 
struct wpabufxml_get_base64_item (const char *data, const char *name, enum http_reply_code *ret)
 

Detailed Description

UPnP XML helper routines Copyright (c) 2006-2007 Sony Corporation Copyright (c) 2008-2009 Atheros Communications Copyright (c) 2009, Jouni Malinen j@w1..nosp@m.fi

See wps_upnp.c for more details on licensing and code history.

Function Documentation

int xml_next_tag ( const char *  in,
const char **  out,
const char **  out_tagname,
const char **  end 
)

Advance to next tag.

Parameters
inInput
outOUT: start of tag just after '<'
out_tagnameOUT: start of name of tag, skipping namespace
endOUT: one after tag
Returns
0 on success, 1 on failure

A tag has form: <left angle="" bracket>=""><...><right angle="" bracket>=""> Within the angle brackets, there is an optional leading forward slash (which makes the tag an ending tag), then an optional leading label (followed by colon) and then the tag name itself.

Note that angle brackets present in the original data must have been encoded as < and > so they will not trouble us.