00001 // -*- c++ -*- 00002 // 00003 // $Id: structs.h,v 1.6 2008-02-26 13:16:08 rafi Exp $ 00004 // 00005 // YAPET -- Yet Another Password Encryption Tool 00006 // Copyright (C) 2008 Rafael Ostertag 00007 // 00008 // This program is free software: you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation, either version 3 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // This program 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, see <http://www.gnu.org/licenses/>. 00020 // 00021 00022 #ifndef _STRUCTS_H 00023 #define _STRUCTS_H 00024 00025 #ifdef HAVE_CONFIG_H 00026 # include <config.h> 00027 #endif 00028 00029 #ifdef HAVE_INTTYPES_H 00030 # include <inttypes.h> 00031 #endif 00032 00033 namespace YAPET { 00034 00035 enum { 00040 HEADER_CONTROL_SIZE = 20, 00044 NAME_SIZE = 128, 00049 HOST_SIZE = 256, 00054 USERNAME_SIZE = 256, 00059 PASSWORD_SIZE = 256, 00064 COMMENT_SIZE = 512 00065 }; 00066 00072 struct FileHeader { 00078 uint8_t version; 00089 uint8_t control[HEADER_CONTROL_SIZE]; 00096 time_t pwset; 00097 }; 00098 00104 struct PasswordRecord { 00112 uint8_t name[NAME_SIZE]; 00118 uint8_t host[HOST_SIZE]; 00124 uint8_t username[USERNAME_SIZE]; 00130 uint8_t password[PASSWORD_SIZE]; 00136 uint8_t comment[COMMENT_SIZE]; 00137 }; 00138 } 00139 00140 #endif // _STRUCTS_H