1*476a4da7Sbluhm /* $OpenBSD: af_frame.c,v 1.2 2025/01/05 12:36:48 bluhm Exp $ */
26fb93e47Sdlg
36fb93e47Sdlg /*
46fb93e47Sdlg * Copyright (c) 2024 David Gwynne <dlg@openbsd.org>
56fb93e47Sdlg *
66fb93e47Sdlg * Permission to use, copy, modify, and distribute this software for any
76fb93e47Sdlg * purpose with or without fee is hereby granted, provided that the above
86fb93e47Sdlg * copyright notice and this permission notice appear in all copies.
96fb93e47Sdlg *
106fb93e47Sdlg * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
116fb93e47Sdlg * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
126fb93e47Sdlg * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
136fb93e47Sdlg * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
146fb93e47Sdlg * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
156fb93e47Sdlg * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
166fb93e47Sdlg * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
176fb93e47Sdlg */
186fb93e47Sdlg
196fb93e47Sdlg #include <sys/param.h>
206fb93e47Sdlg #include <sys/socket.h>
216fb93e47Sdlg #include <sys/protosw.h>
226fb93e47Sdlg #include <sys/domain.h>
236fb93e47Sdlg #include <sys/systm.h>
246fb93e47Sdlg
256fb93e47Sdlg #include <net/if_types.h>
266fb93e47Sdlg
276fb93e47Sdlg #include <net/if.h>
286fb93e47Sdlg #include <net/if_arp.h>
296fb93e47Sdlg #include <netinet/in.h>
306fb93e47Sdlg #include <netinet/if_ether.h>
316fb93e47Sdlg
326fb93e47Sdlg const struct domain framedomain;
336fb93e47Sdlg
346fb93e47Sdlg /* reach over to if_ethersubr.c */
356fb93e47Sdlg int ether_frm_ctloutput(int, struct socket *, int, int, struct mbuf *);
366fb93e47Sdlg extern const struct pr_usrreqs ether_frm_usrreqs;
376fb93e47Sdlg
386fb93e47Sdlg static const struct protosw framesw[] = {
396fb93e47Sdlg {
406fb93e47Sdlg .pr_type = SOCK_DGRAM,
416fb93e47Sdlg .pr_domain = &framedomain,
426fb93e47Sdlg .pr_protocol = IFT_ETHER,
43*476a4da7Sbluhm .pr_flags = PR_ATOMIC|PR_ADDR|PR_MPINPUT,
446fb93e47Sdlg
456fb93e47Sdlg .pr_ctloutput = ether_frm_ctloutput,
466fb93e47Sdlg .pr_usrreqs = ðer_frm_usrreqs,
476fb93e47Sdlg .pr_sysctl = NULL /* ether_frm_sysctl */,
486fb93e47Sdlg },
496fb93e47Sdlg };
506fb93e47Sdlg
516fb93e47Sdlg const struct domain framedomain = {
526fb93e47Sdlg .dom_family = AF_FRAME,
536fb93e47Sdlg .dom_name = "frame",
546fb93e47Sdlg .dom_protosw = framesw,
556fb93e47Sdlg .dom_protoswNPROTOSW = &framesw[nitems(framesw)],
566fb93e47Sdlg };
576fb93e47Sdlg
586fb93e47Sdlg void
af_frameattach(int n)596fb93e47Sdlg af_frameattach(int n)
606fb93e47Sdlg {
616fb93e47Sdlg /* nop */
626fb93e47Sdlg }
63