MCPcopy Create free account
hub / github.com/F-Stack/f-stack / accept_filt_generic_mod_event

Function accept_filt_generic_mod_event

freebsd/kern/uipc_accf.c:127–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127int
128accept_filt_generic_mod_event(module_t mod, int event, void *data)
129{
130 struct accept_filter *p;
131 struct accept_filter *accfp = (struct accept_filter *) data;
132 int error;
133
134 switch (event) {
135 case MOD_LOAD:
136 p = malloc(sizeof(*p), M_ACCF, M_WAITOK);
137 bcopy(accfp, p, sizeof(*p));
138 error = accept_filt_add(p);
139 break;
140
141 case MOD_UNLOAD:
142 /*
143 * Do not support unloading yet. we don't keep track of
144 * refcounts and unloading an accept filter callback and then
145 * having it called is a bad thing. A simple fix would be to
146 * track the refcount in the struct accept_filter.
147 */
148 if (unloadable != 0) {
149 error = accept_filt_del(accfp->accf_name);
150 } else
151 error = EOPNOTSUPP;
152 break;
153
154 case MOD_SHUTDOWN:
155 error = 0;
156 break;
157
158 default:
159 error = EOPNOTSUPP;
160 break;
161 }
162
163 return (error);
164}
165
166int
167accept_filt_getopt(struct socket *so, struct sockopt *sopt)

Callers

nothing calls this directly

Calls 3

mallocFunction · 0.85
accept_filt_addFunction · 0.85
accept_filt_delFunction · 0.85

Tested by

no test coverage detected