Commit Graph

28 Commits

Author SHA1 Message Date
Dan Winship
211ed1775d gsocket: add getsockopt/setsockopt wrappers
Add g_socket_get_option() and g_socket_set_option(), wrapping
getsockopt/setsockopt for the case of integer-valued options. Update
code to use these instead of the underlying calls.

https://bugzilla.gnome.org/show_bug.cgi?id=623187
2012-12-12 15:20:22 +01:00
Dan Winship
b377e69685 Add gnetworking.h
Install a public "gnetworking.h" header that can be used to include
the relevant OS-dependent networking headers. This does not really
abstract away unix-vs-windows however; error codes, in particular,
are incompatible.

gnetworkingprivate.h now contains just a few internal URI-related
functions

Also add a g_networking_init() function to gnetworking.h, which can be
used to explicitly initialize OS-level networking, rather than having
that happen as a side-effect of registering GInetAddress.

https://bugzilla.gnome.org/show_bug.cgi?id=623187
2012-12-12 15:20:22 +01:00
Dan Winship
d21309464c gio: port networking classes from GSimpleAsyncResult to GTask
https://bugzilla.gnome.org/show_bug.cgi?id=661767
2012-10-10 10:29:37 -04:00
Dan Winship
e011d2c921 Add g_type_ensure() and use it rather than playing games with volatile
https://bugzilla.gnome.org/show_bug.cgi?id=605976
2012-05-15 13:46:38 -04:00
Alexander Larsson
386f0f29fd Fall back to SO_PEERCRED if credentials passing fails
Turns out libdbus doesn't send struct ucred credentials on linux, but
just relies on the SO_PEERCRED support. However, gdbus does send, and
expect to recieve a ucred credential. So, when libdbus talks to a
gdbus server the authentication fails to send the credentials.

We fix this by falling back to g_socket_get_credentials() if we don't
get any credential messages.
2012-04-12 16:50:20 +02:00
Xavier Claessens
d077b66ee9 GUnixConnection: add async variant for send/receive_credentials()
https://bugzilla.gnome.org/show_bug.cgi?id=629503
2012-01-18 15:21:56 +01:00
Antoine Jacoutot
77f4f5aa02 Add glib credentials support to OpenBSD.
https://bugzilla.gnome.org/show_bug.cgi?id=650885
2011-05-27 14:22:56 -04:00
Thomas Hindoe Paaboel Andersen
f42d97b88b docs: fix typos in networking classes 2011-04-20 21:08:15 +02:00
David Zeuthen
0729260141 Silence a bunch of -Wunused-but-set-variable warnings
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-04-08 15:44:25 -04:00
Johan Dahlin
fdaaa22b58 Correct gtk-doc SECTION: syntax
g-ir-scanner does not allow a space between the : and the
section name.
2011-02-01 16:18:02 -02:00
Pavel Holejsovsky
add8cf9c09 Add GI annotations to Gio highlevel network functionality 2010-12-29 16:02:26 +01:00
Johan Dahlin
30132c44c1 Add a lot of missing annotations 2010-09-24 18:24:41 -03:00
David Zeuthen
a51df8cefb GUnixConnection: Remove comment about Linux
Since the previous commit, the g_unix_connection_send_credentials() /
g_unix_connection_receive_credentials() functions now also works on
FreeBSD since GUnixCredentialsMessage now works there.

The main idea is that the g_unix_connection_send_credentials() /
g_unix_connection_receive_credentials() functions are the "main" API
for getting credentials (one way or the other). So it's better to
avoid advertising where it is currently implemented.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-09-09 14:17:52 -04:00
David Zeuthen
7eba41346e Bug 617483 – Credentials passing
- Make GCredentials instance and class structures private so it can't
   be subclassed and we don't have to worry about ABI compat
   issues. This also allows us to get rid of the GCredentialsPrivate
   struct.

 - Add a GCredentialsType enumeration that is used whenever exchanging
   pointers with the user. This allows us to support OSes with
   multiple native credential types. In particular, it allows
   supporting OSes where the native credential evolves or even changes
   over time.

 - Add g_socket_get_credentials() method.

 - Add tests for g_socket_get_credentials(). Right now this is in the
   GDBus peer-to-peer test case but we can change that later.

 - Move GTcpConnection into a separate gtk-doc page as was already
   half-done with GUnixConnection. Also finish the GUnixConnection
   move and ensure send_credentials() and receive_credentials()
   methods are in the docs. Also nuke comment about GTcpConnection
   being empty compared to its superclass.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-20 16:34:18 -04:00
Ryan Lortie
5344c22810 gio/ docs fixup 2010-07-12 18:30:14 -04:00
Ryan Lortie
5b946e0504 gio/: fully remove gioalias hacks 2010-07-07 19:53:22 -04:00
Matthias Clasen
8a105625b0 Documentation fixups 2010-06-17 16:07:52 -04:00
Ryan Lortie
d8d1a02c55 include gunixcredentialsmessage from unixsocket
fixes a build issue
2010-05-14 15:31:14 +02:00
Matthias Clasen
6223341cac Merge branch 'gdbus-merge'
Conflicts:
	docs/reference/gio/gio-docs.xml
	docs/reference/gio/gio-sections.txt
	gio/tests/Makefile.am
2010-05-13 23:08:34 -04:00
Matthias Clasen
9e90b381f5 Remove the credentials argument from g_unix_connect_send_credentials()
Instead, make it always send the current credentials.
2010-05-13 14:29:39 -04:00
Matthias Clasen
7ca2e00054 Doc improvements
Make sure all unix-specific apis are marked as such.
2010-05-08 23:28:17 -04:00
David Zeuthen
c490c14f4e Set up gtk-doc for GDBus
Also move send_credentials() and receive_credentials() to
GUnixConnection. This code might change, discussion is still ongoing
in

 https://bugzilla.gnome.org/show_bug.cgi?id=617483.
2010-05-06 15:31:45 -04:00
Dan Winship
53beca955e Add GCancellables to GSocket ops
Currently, to implement cancellability correctly, all synchronous
calls to GSocket must be preceded by a g_socket_condition_wait() call,
(even though GSocket does this internally as well) and all
asynchronous calls must do occasional manual
g_cancellable_is_cancelled() checks. Since it's trivial to do these
checks inside GSocket instead, and we don't particularly want to
encourage people to use the APIs non-cancellably, move the
cancellation support into GSocket and simplify the existing callers.

http://bugzilla.gnome.org/show_bug.cgi?id=586797
2009-06-30 11:42:17 -04:00
Matthias Clasen
06144900ec Documentation and coding style fixups
Lots of pedanic changes.
2009-05-27 18:20:08 -04:00
Christian Persch
80cfd099f3 Use g_set_error_literal
Bug #583206.
2009-05-20 13:46:39 +02:00
Alexander Larsson
5cd86fbda6 Remove protocol names, instead use an enum with common protocols
The whole protocol name thing is pretty weird. The getprotobyname functions
seem to only specify one mapping for name <-> ids, so all families/types
must use the same values. Plus the values used for the protocols are
standardized by IANA, so are always the same.

So, we drop using names for protocols, intead introducing an enum with
a few commonly availible and used protocols.
2009-05-20 12:14:50 +02:00
Alexander Larsson
6ea86cc57f Update the docs for the new network APIs
This imports the network APIs into the gio reference docs, and cleans
up a bunch of gtk-doc warnings and documentation issues.
2009-05-18 13:07:43 +02:00
Alexander Larsson
ce8361217c Import all the highlevel socket classes from gnio 2009-05-15 21:26:24 +02:00