struct type declarations in dns_server

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

struct type declarations in dns_server

Samba - samba-technical mailing list
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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: struct type declarations in dns_server

Samba - samba-technical mailing list
Hi Dimitris,

On Tue, 1 Aug 2017 18:50:42 +0300, Dimitris Gravanis via samba-technical wrote:

> 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):

struct task_server is defined in source4/smbd/service_task.h, but
shouldn't be needed for your implementation. Likewise, ldb_context is
opaque, so internals shouldn't be of concern to your code - it can be
initialised via ldb_init(), and free'd via talloc_free() (see ldb.h).
This will hopefully become clearer when you're working out of the main
Samba source tree, rather than your standalone repo.

> 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?

Please publish your changes as a fork of the samba master branch, then
send through a link to your repository URL via email. The samba-team
mirror on github is read-only, so samba-technical submissions are always
preferred.

Cheers, David

Loading...