modules_s/uac/auth_hdr.h

00001 /*
00002  * $Id$
00003  *
00004  * Copyright (C) 2005 Voice Sistem SRL
00005  *
00006  * This file is part of SIP Express Router.
00007  *
00008  * UAC SER-module is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License
00010  * as published by the Free Software Foundation; either version 2
00011  * of the License, or (at your option) any later version.
00012  *
00013  * UAC SER-module is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021  *
00022  * For any questions about this software and its license, please contact
00023  * Voice Sistem at following e-mail address:
00024  *         office@voice-sistem.ro
00025  *
00026  *
00027  * History:
00028  * ---------
00029  *  2005-01-31  first version (ramona)
00030  */
00031 
00032 
00033 #ifndef _UAC_AUTH_HDR_H_
00034 #define _UAC_AUTH_HDR_H_
00035 
00036 #include "../../str.h"
00037 
00038 #include "auth.h"
00039 
00040 struct authenticate_body {
00041         int flags;
00042         str realm;
00043         str domain;
00044         str nonce;
00045         str opaque;
00046         str qop;
00047 };
00048 
00049 #define AUTHENTICATE_MD5         (1<<0)
00050 #define AUTHENTICATE_MD5SESS     (1<<1)
00051 #define AUTHENTICATE_STALE       (1<<2)
00052 #define QOP_AUTH                 (1<<3)
00053 #define QOP_AUTH_INT             (1<<4)
00054 
00055 int parse_authenticate_body( str *body, struct authenticate_body *auth);
00056 
00057 str* build_authorization_hdr(int code, str *uri,
00058                 struct uac_credential *crd, struct authenticate_body *auth,
00059                 char *response);
00060 
00061 #endif