1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-22 07:33:16 +03:00
Commit Graph

45 Commits

Author SHA1 Message Date
Stefan Metzmacher
5534ba591d r21594: give the same error in all resolve backends
metze
2007-10-10 14:49:03 -05:00
Stefan Metzmacher
49591d6996 r21593: give a more useful error, when we can't resolve a long name
via broadcast of wins

metze
2007-10-10 14:49:02 -05:00
Stefan Metzmacher
643a38bc30 r19645: don't pass NULL as mem_ctx...
metze
2007-10-10 14:25:25 -05:00
Stefan Metzmacher
a5d36a6dde r19642: convert host.c to new composite api
metze
2007-10-10 14:25:24 -05:00
Stefan Metzmacher
800999733e r19639: convert nbtlist.c to new composite api
metze
2007-10-10 14:25:23 -05:00
Stefan Metzmacher
617f9c70c1 r19638: convert resolve.c to the new composite api
metze
2007-10-10 14:25:23 -05:00
Stefan Metzmacher
f20e251bfd r17586: merge lib/netif into lib/socket and use -lnsl -lsocket on the
configure check for the interfaces.

should fix the build on some old sun boxes

metze
2007-10-10 14:15:39 -05:00
Andrew Tridgell
61c6100617 r15854: more talloc_set_destructor() typesafe fixes 2007-10-10 14:08:32 -05:00
Jelmer Vernooij
51b4270513 r14542: Remove librpc, libndr and libnbt from includes.h 2007-10-10 13:58:42 -05:00
Jelmer Vernooij
3dd477ca51 r14464: Don't include ndr_BASENAME.h files unless strictly required, instead
try to include just the BASENAME.h files (containing only structs)
2007-10-10 13:57:27 -05:00
Jelmer Vernooij
1228358767 r13924: Split more prototypes out of include/proto.h + initial work on header
file dependencies
2007-10-10 13:52:24 -05:00
Andrew Tridgell
d004e250b6 r13505: allow servers to bind to non-broadcast interfaces. Servers now
specifically ask for iface_n_bcast() and have to check if it returns
NULL, in which case it is a non-broadcast interface
2007-10-10 13:51:56 -05:00
Jelmer Vernooij
70e7449318 r12608: Remove some unused #include lines. 2007-10-10 13:49:03 -05:00
Jelmer Vernooij
0aca5fd513 r12542: Move some more prototypes out to seperate headers 2007-10-10 13:47:55 -05:00
Andrew Tridgell
f9413ce792 r12116: got rid of composite_trigger_done() and composite_trigger_error(), and
instead make the normal composite_done() and composite_error()
functions automatically trigger a delayed callback if the caller has
had no opportunity to setup a async callback

this removes one of the common mistakes in writing a composite function
2007-10-10 13:47:11 -05:00
Rafal Szczesniak
ef29863d99 r10636: Formatting for better readability.
rafal
2007-10-10 13:39:13 -05:00
Stefan Metzmacher
4527815a0a r10504: - seperate implementation specific stuff, from the generic composite
stuff.
- don't use SMBCLI_REQUEST_* state's in the genreic composite stuff
- move monitor_fn to libnet.

NOTE: I have maybe found some bugs, in code that is dirrectly in DONE or ERROR
      state in the _send() function. I haven't fixed this bugs in this
      commit! We may need some composite_trigger_*() functions or so.
      And maybe some other generic helper functions...

metze
2007-10-10 13:38:57 -05:00
Jelmer Vernooij
29919a7105 r10438: Move portability functions to lib/replace/; replace now simply ensures
that a given set of (working) POSIX functions are available (without
prefixes to their names, etc). See lib/replace/README for a list.

Functions that behave different from their POSIX specification
(such as sys_select, sys_read, etc) have kept the sys_ prefix.
2007-10-10 13:38:45 -05:00
Volker Lendecke
17dbbf965b r10395: While playing with winbind, I found a segfault because I had given
resolve_name_send a stack-allocated method list. Duplicate it.

Volker
2007-10-10 13:38:39 -05:00
Andrew Tridgell
9cc000d868 r10200: added a composite_trigger_done() call that allows a composite function
to cause an event to happen immediately. This allows metzes patch for
recognising IPs in resolve_name() to work, and also allows us to
remove some of the other code where we currently do specific checks
for is_ipaddress().
2007-10-10 13:38:08 -05:00
Andrew Tridgell
b3d491b210 r9702: r9680@blu: tridge | 2005-08-27 18:45:08 +1000
- fixed ncacn_ip_tcp to use the generic async name resolution methods,
   so NBT names now work (as requested several times by abartlet!)

 - changed resolve_name() to take an event_context, so it doesn't cause
   the whole process to block

 - cleaned up the talloc_find_parent_bytype() calls to go via a cleaner
   event_context_find() call
2007-10-10 13:34:51 -05:00
Andrew Tridgell
0f8f1cd18e r8628: add retries to the normal paths of nbt name resolution. UDP broadcasts are not 100% reliable :) 2007-10-10 13:29:46 -05:00
Andrew Tridgell
2fafc23052 r8002: favor addresses on our local interfaces in NBT name resolution if
possible. This is needed because w2k3 will return bogus IPs in its
name resolution replies when it has an unplugged network interface.
2007-10-10 13:18:57 -05:00
Andrew Tridgell
c435843c66 r7856: fixed warning of 'methods' shadowed variable 2007-10-10 13:18:43 -05:00
Rafal Szczesniak
84315cdf0d r7813: Make async request independent from config file routines.
rafal
2007-10-10 13:18:38 -05:00
Rafal Szczesniak
121cf5ec3e r7735: Extend resolve_name function so that it's possible to pass resolve
methods explicitly or NULL for defaults saved in smb.conf.

rafal
2007-10-10 13:18:28 -05:00
Tim Potter
b896daf11c r6933: Add a couple of helper functions for creating nbt names. 2007-10-10 13:16:58 -05:00
Tim Potter
c23f767a9f r5551: Protect against falling off the end of the name resolve order list
if a name is not found.
2007-10-10 13:10:54 -05:00
Tim Potter
328f37a3e8 r5550: Initialise retry count - valgrind was freaking out because this value
was not set.
2007-10-10 13:10:54 -05:00
Andrew Tridgell
80a95d5688 r5328: - allow case sensitive nbt name lookups
- added --case-sensitive option to nmblookup

 - added case sensitivity tests to the NBT-WINS test
2007-10-10 13:09:42 -05:00
Andrew Tridgell
9db6c79e90 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
2007-10-10 13:09:38 -05:00
Andrew Tridgell
bb1ab11d8e r5294: - added a separate NBT-WINS test for WINS operations (register, refresh, release and query)
- change the iface_n_*() functions to return a "const char *" instead of a "struct ipv4_addr"
  I think that in general we should move towards "const char *" for
  all IP addresses, as this makes IPv6 much easier, and is also easier
  to debug. Andrew, when you get a chance, could you fix some of the
  auth code to use strings for IPs ?

- return a NTSTATUS error on bad name queries and node status instead
  of using rcode. This makes the calling code simpler.

- added low level name release code in libcli/nbt/

- use a real IP in the register and wins nbt torture tests, as w2k3
  WINS server silently rejects some operations that don't come from the
  IP being used (eg. it says "yes" to a release, but does not in fact
  release the name)
2007-10-10 13:09:37 -05:00
Andrew Tridgell
7f54c8a339 r5197: moved events code to lib/events/ (suggestion from metze) 2007-10-10 13:09:30 -05:00
Andrew Tridgell
236403cc4d r5195: most events don't need the time of the event, so save a gettimeofday() call
and just use timeval_current() when its actually needed
2007-10-10 13:09:30 -05:00
Andrew Tridgell
d7b4b6de51 r5185: make all the events data structures private to events.c. This will
make it possible to add optimisations to the events code such as
keeping the next timed event in a sorted list, and using epoll for
file descriptor events.

I also removed the loop events code, as it wasn't being used anywhere,
and changed timed events to always be one-shot (as adding a new timed
event in the event handler is so easy to do if needed)
2007-10-10 13:09:29 -05:00
Andrew Tridgell
cf11d05e35 r5126: the composite code is no longer client specific or smb specific, so
rename the core structure to composite_context and the wait routine to
composite_wait() (suggestion from metze)
2007-10-10 13:09:25 -05:00
Andrew Tridgell
506e1e823c r5116: fixed build of the nbtlist code 2007-10-10 13:09:24 -05:00
Andrew Tridgell
7f981b9ed9 r4944: every event_add_*() caller was having to call talloc_steal() to take
control of the event, so instead build that into the function. If you
pass NULL as mem_ctx then it leaves it as a child of the events
structure.
2007-10-10 13:09:08 -05:00
Andrew Tridgell
a3c7417cfe r4943: Smplified the events handling code a lot. The first source of
complexity was that events didn't automatically cleanup
themselves. This was because the events code was written before we had
talloc destructors, so you needed to call event_remove_XX() to clean
the event out of the event lists from every piece of code that used
events. I have now added automatic event destructors, which in turn
allowed me to simplify a lot of the calling code.

The 2nd source of complexity was caused by the ref_count, which was
needed to cope with event handlers destroying events while handling
them, which meant the linked lists became invalid, so the ref_count ws
used to mark events for later destruction.

The new system is much simpler. I now have a ev->destruction_count,
which is incremented in all event destructors. The event dispatch code
checks for changes to this and handles it.
2007-10-10 13:09:08 -05:00
Andrew Tridgell
dd5b43ed37 r4922: fixed an infinite loop in the name resolve code when handling a method
in smb.conf that isn't implemented in the library
2007-10-10 13:09:06 -05:00
Andrew Tridgell
3268d523cc r4919: if a caller doesn't provide an event context to the resolver library,
then create one. This fixes a crash in the RAW-NEGNOWAIT test for
'host' resolution.
2007-10-10 13:09:06 -05:00
Andrew Tridgell
3d40b47990 r4916: added "host" name resolution using fork() per gethostbyname()
comments welcome, but please think about the alternatives first :-)
2007-10-10 13:09:05 -05:00
Andrew Tridgell
266fd2751c r4898: - removed the unused wins_srv_*() code
- expanded the generic async name resolver to try multiple methods

- added wins resolutions to the list of methods tried

- fixed up the random trn id generation to use the good random generator
2007-10-10 13:09:04 -05:00
Andrew Tridgell
c1063919c0 r4896: make sure the event context doesn't go away while waiting for event completion 2007-10-10 13:09:04 -05:00
Andrew Tridgell
239c310f25 r4891: - added a generic resolve_name() async interface in libcli/resolve/,
which will eventually try all resolution methods setup in smb.conf

 - only resolution backend at the moment is bcast, which does a
   parallel broadcast to all configured network interfaces, and takes
   the first reply that comes in (this nicely demonstrates how to do
   parallel requests using the async APIs)

 - converted all the existing code to use the new resolve_name() api

 - removed all the old nmb code (yay!)
2007-10-10 13:09:03 -05:00