src/fritz.c File Reference

Fritz!Box Webinterface parsing code. More...

#include "../include/billigertelefonieren.h"

Include dependency graph for fritz.c:


Functions

size_t calculatePrefixSettingsLength (char *providers[PR_TYPES+1], int crlf)
 calculate the length for the prefix settings
int createPrefixSettings (char *providers[PR_TYPES+1], char *contents, int crlf)
 create prefix settings generated from the providers
int getAndUpdatePrefixGroups (struct sockaddr_in *serveraddr, char *providers[PR_TYPES+1], int bVerbose)
 find out which prefix groups are defined and redefine them
int loginOnBox (struct sockaddr_in *serveraddr)
 send the password to the fritz box since we want to login
int postSettingsToWebcm (struct sockaddr_in *serveraddr, char *providers[PR_TYPES+1])
 pass providers to webcm via a HTTP POST request
int runWebcmWithSettings (int function, char *url, char *contents, char *bigbuffer)
 pass providers to webcm via a pipe (emulates a HTTP request)

Detailed Description

Fritz!Box Webinterface parsing code.

contains all code related to the Fritz!Box webinterface. (c) 2005-2007 Markus Drescher last change: 28.11.07

---------------------------------------------------------------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ----------------------------------------------------------------------------


Function Documentation

size_t calculatePrefixSettingsLength ( char *  providers[PR_TYPES+1],
int  crlf 
)

calculate the length for the prefix settings

calculatePrefixSettingsLength

Parameters:
providers the providers to use at the current time
crlf use (cr)lf
Returns:
length needed

int createPrefixSettings ( char *  providers[PR_TYPES+1],
char *  contents,
int  crlf 
)

create prefix settings generated from the providers

createPrefixSettings

Parameters:
providers the providers to use at the current time
contents result, the settings to be sent
crlf use (cr)lf
Returns:
FR_CP_ERR_SUCCESS, ...

int getAndUpdatePrefixGroups ( struct sockaddr_in *  serveraddr,
char *  providers[PR_TYPES+1],
int  bVerbose 
)

find out which prefix groups are defined and redefine them

getAndUpdatePrefixGroups

Parameters:
serveraddr internet address of the fritz box
providers the providers for the prefix groups
bVerbose be verbose in this function (printf!)
Returns:
FR_GU_ERR_SUCCESS, ...
Todo:
use local pipe access to webcm

int loginOnBox ( struct sockaddr_in *  serveraddr  ) 

send the password to the fritz box since we want to login

loginOnBox

Parameters:
serveraddr internet address of the fritz box
Returns:
FR_LI_ERR_SUCCESS, ...
Todo:
use local pipe access to webcm, check if password was valid.

int postSettingsToWebcm ( struct sockaddr_in *  serveraddr,
char *  providers[PR_TYPES+1] 
)

pass providers to webcm via a HTTP POST request

postSettingsToWebcm

Parameters:
serveraddr the address of our fritz box
providers the providers to use at the current time
Returns:
FR_PS_ERR_SUCCESS, ...

int runWebcmWithSettings ( int  function,
char *  url,
char *  contents,
char *  bigbuffer 
)

pass providers to webcm via a pipe (emulates a HTTP request)

runWebcmWithSettings

Parameters:
function what should we do?
url url to download
contents contents to post
bigbuffer result
Returns:
0 for success, -1 for ...

SourceForge.net Logo