2004-08-18 11:01:06 +00:00
/*
Unix SMB / CIFS implementation .
Copyright ( C ) Stefan Metzmacher 2004
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 .
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 .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
*/
# include "includes.h"
2004-11-02 11:42:35 +00:00
# include "libnet/libnet.h"
2005-06-16 11:36:09 +00:00
# include "lib/events/events.h"
2004-08-18 11:01:06 +00:00
2005-06-16 11:36:09 +00:00
struct libnet_context * libnet_context_init ( struct event_context * ev )
2004-08-18 11:01:06 +00:00
{
struct libnet_context * ctx ;
2005-07-02 14:32:49 +00:00
/* create brand new libnet context */
2006-09-16 17:59:33 +00:00
ctx = talloc ( ev , struct libnet_context ) ;
2004-08-18 11:01:06 +00:00
if ( ! ctx ) {
return NULL ;
}
2005-07-02 14:32:49 +00:00
/* events */
2005-06-16 11:36:09 +00:00
if ( ev = = NULL ) {
2005-11-18 23:27:58 +00:00
ev = event_context_find ( ctx ) ;
2005-06-16 11:36:09 +00:00
if ( ev = = NULL ) {
talloc_free ( ctx ) ;
return NULL ;
}
}
ctx - > event_ctx = ev ;
2004-08-18 11:01:06 +00:00
2005-11-20 22:00:47 +00:00
/* name resolution methods */
2006-01-13 00:54:53 +00:00
ctx - > name_res_methods = str_list_copy ( ctx , lp_name_resolve_order ( ) ) ;
2006-05-15 21:49:27 +00:00
2006-08-21 20:52:14 +00:00
/* connected services' params */
ZERO_STRUCT ( ctx - > samr ) ;
ZERO_STRUCT ( ctx - > lsa ) ;
2006-05-17 22:21:24 +00:00
2004-08-18 11:01:06 +00:00
return ctx ;
}