kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: michi1@michaelblizek.twilightparadox.com (michi1 at michaelblizek.twilightparadox.com)
To: kernelnewbies@lists.kernelnewbies.org
Subject: difference between struct proto and struct proto_ops
Date: Sun, 25 Jan 2015 11:19:45 +0100	[thread overview]
Message-ID: <20150125101944.GA4438@grml> (raw)
In-Reply-To: <54C47A87.7060200@gmail.com>

Hi!

On 10:39 Sun 25 Jan     , nawab wrote:
> 
> 
> What is the difference between struct proto and struct proto_ops : Both 
> are having the same functions:setsockopt,getsockopt,bind,connect etc...
> 
> So which functions are called when we call connect ,bind from userspace....

The entry point from userspace is net/socket.c . The functions which are
called is those from "struct proto_ops".

Both "struct sock" and "struct proto" look pretty weird to me too. It seems
that they are meant to be tools which make implementing protocols easier,
but they are sometimes required by upper layers. Take a look at e.g.
sock_getsockopt().

	-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com

      reply	other threads:[~2015-01-25 10:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-25  5:09 difference between struct proto and struct proto_ops nawab
2015-01-25 10:19 ` michi1 at michaelblizek.twilightparadox.com [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150125101944.GA4438@grml \
    --to=michi1@michaelblizek.twilightparadox.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).