struct type declarations in dns_server

Dimitris Gravanis dimgrav at gmail.com
Tue Aug 1 15:50:42 UTC 2017


Hi,

I'm working on the gss-tsig crypto test on client_crypto.c and I have to 
declare and assign initial values to the parameters of the functions 
that are going to be tested.

For example (in dns_server.h):

|struct dns_server {||
||    struct task_server *task;||
||    struct ldb_context *samdb;||
||    struct dns_server_zone *zones;||
||    struct dns_server_tkey_store *tkeys;||
||    struct cli_credentials *server_credentials;||
||    uint16_t max_payload;||
||};|

on the above struct, I need to find where task_server, ldb_context are 
defined. Same goes for other structs that are not defined in dns.idl or 
header files I've come across. Therefore, I declare them as variables in 
their respective tests, but I don't assign values to them, as seen below 
(in cli_crypto_test.c):

|/* ||
|| * error codes||
|| *  0 : (success) packet signed with MAC and rebuilt||
|| * -1 : unexpected WERROR output||
|| * -2 : unexpected DNS_ERR output||
|| */||
||static int gen_tsig_test(void **state)||
||{||
||    /* incomplete declarations */||
||    TALLOC_CTX *mem_ctx;||
||    DATA_BLOB in_test = (DATA_BLOB) {.data = NULL, .length = SIZE_MAX};||
||    struct dns_client *test_client;||
||    struct dns_request_state *test_state;||
||    struct dns_name_packet *test_packet;|

You can check my code in full on my temporary repo 
<https://github.com/dimgrav/Samba-GSOC2017>.

I also forked samba-team/samba mirror on GitHub. To which branch should 
I make a pull request to add my code to the mirror in the near future?

Cheers,

Dimitris




More information about the samba-technical mailing list