adapted database entries

This commit is contained in:
Andreas Steffen 2011-11-19 01:55:18 +01:00
parent 031be70453
commit 2efc03758d
6 changed files with 14 additions and 100 deletions

View File

@ -405,27 +405,27 @@ INSERT INTO product_file (
/* Product Component */
INSERT INTO product_component (
product, component
product, component, sequence
) VALUES (
4, 1
4, 1, 1
);
INSERT INTO product_component (
product, component
product, component, sequence
) VALUES (
4, 2
4, 2, 2
);
INSERT INTO product_component (
product, component
product, component, sequence
) VALUES (
7, 1
7, 1, 1
);
INSERT INTO product_component (
product, component
product, component, sequence
) VALUES (
7, 2
7, 2, 2
);
/* File Hashes */
@ -1296,13 +1296,13 @@ INSERT INTO file_hashes (
);
INSERT INTO component_hashes (
component, product, sequence, algo, hash
component, product, algo, hash
) VALUES (
2, 4, 1, 32768, X'9704353630674bfe21b86b64a7b0f99c297cf902'
2, 4, 32768, X'9704353630674bfe21b86b64a7b0f99c297cf902'
);
INSERT INTO component_hashes (
component, product, sequence, algo, hash
component, product, algo, hash
) VALUES (
2, 4, 2, 32768, X'8397d8048ee36d7955e38da16fc33e86ef61d6b0'
2, 4, 32768, X'8397d8048ee36d7955e38da16fc33e86ef61d6b0'
);

View File

@ -39,7 +39,7 @@ CREATE TABLE product_component (
product INTEGER NOT NULL,
component INTEGER NOT NULL,
sequence INTEGER DEFAULT 0,
PRIMARY KEY (product, component, sequence)
PRIMARY KEY (product, component)
);
DROP TABLE IF EXISTS file_hashes;
@ -56,9 +56,8 @@ DROP TABLE IF EXISTS component_hashes;
CREATE TABLE component_hashes (
component INTEGER NOT NULL,
product INTEGER NOT NULL,
sequence INTEGER DEFAULT 0,
algo INTEGER NOT NULL,
hash BLOB NOT NULL,
PRIMARY KEY(component, product, sequence, algo)
PRIMARY KEY(component, product, algo)
);

View File

@ -1,85 +0,0 @@
/*
* Copyright (C) 2011 Sansar Choinyambuu
* HSR Hochschule fuer Technik Rapperswil
*
* 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. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* 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.
*/
#include "pts_funct_comp_evid_req.h"
#include <utils/linked_list.h>
#include <debug.h>
typedef struct private_pts_funct_comp_evid_req_t private_pts_funct_comp_evid_req_t;
/**
* Private data of a private_pts_funct_comp_evid_req_t object.
*
*/
struct private_pts_funct_comp_evid_req_t {
/**
* Public pts_funct_comp_evid_req_t interface.
*/
pts_funct_comp_evid_req_t public;
/**
* List of Functional Component Evidence Requests
*/
linked_list_t *list;
};
METHOD(pts_funct_comp_evid_req_t, get_req_count, int,
private_pts_funct_comp_evid_req_t *this)
{
return this->list->get_count(this->list);
}
METHOD(pts_funct_comp_evid_req_t, add, void,
private_pts_funct_comp_evid_req_t *this,
funct_comp_evid_req_entry_t *entry)
{
this->list->insert_last(this->list, entry);
}
METHOD(pts_funct_comp_evid_req_t, create_enumerator, enumerator_t*,
private_pts_funct_comp_evid_req_t *this)
{
return this->list->create_enumerator(this->list);
}
METHOD(pts_funct_comp_evid_req_t, destroy, void,
private_pts_funct_comp_evid_req_t *this)
{
this->list->destroy(this->list);
free(this);
}
/**
* See header
*/
pts_funct_comp_evid_req_t *pts_funct_comp_evid_req_create()
{
private_pts_funct_comp_evid_req_t *this;
INIT(this,
.public = {
.get_req_count = _get_req_count,
.add = _add,
.create_enumerator = _create_enumerator,
.destroy = _destroy,
},
.list = linked_list_create(),
);
return &this->public;
}