X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=common%2Fapp.h;h=04d8fa5fbe064099218c4342c7c460d160baab30;hb=a06b78f6b47c6e5287ea9a5c935afea4ded6e0b8;hp=b45f4724e551192d0c2836337b6eb3032023cf52;hpb=d119f69edc7c2a9ad2ded2be7fe71eae89926f92;p=blerg.git diff --git a/common/app.h b/common/app.h index b45f472..04d8fa5 100644 --- a/common/app.h +++ b/common/app.h @@ -4,13 +4,14 @@ #ifndef _APP_H #define _APP_H -#include #include "database.h" #include "config.h" +#include "auth.h" #define REALM "Blerg" #define CONTENT_401 "401 Unauthorized

401 Unauthorized

DENIED" +#define CONTENT_403 "403 Forbidden

403 Forbidden

Go away." #define CONTENT_404 "404 Not Found

404 Not Found

I couldn't find that." #define CONTENT_405 "405 Method Not Allowed

405 Method Not Allowed

I'm sorry, Dave. I'm afraid I can't do that." #define JSON_SUCCESS "{\"status\": \"success\"}" @@ -28,7 +29,13 @@ struct url_info { uint64_t record_to; }; +struct auth_cookie { + char name[MAX_TAG_LENGTH + 1]; + char token[TOKEN_SIZE * 2 + 1]; +}; + int parse_url_info(const char *url, struct url_info *info); +int parse_auth_cookie(const char *str, struct auth_cookie *cookie); uint64_t *make_sequential_list(uint64_t from, uint64_t to); #endif /* _APP_H */