Lines Matching refs:proto
46 struct proto *pc_proto;
54 static TAILQ_HEAD(, proto) protos = TAILQ_HEAD_INITIALIZER(protos);
57 proto_register(struct proto *proto, bool isdefault) in proto_register() argument
62 TAILQ_INSERT_HEAD(&protos, proto, prt_next); in proto_register()
66 TAILQ_INSERT_TAIL(&protos, proto, prt_next); in proto_register()
71 proto_alloc(struct proto *proto, int side) in proto_alloc() argument
75 PJDLOG_ASSERT(proto != NULL); in proto_alloc()
82 conn->pc_proto = proto; in proto_alloc()
108 struct proto *proto; in proto_common_setup() local
116 TAILQ_FOREACH(proto, &protos, prt_next) { in proto_common_setup()
118 if (proto->prt_connect == NULL) { in proto_common_setup()
121 ret = proto->prt_connect(srcaddr, dstaddr, in proto_common_setup()
125 if (proto->prt_server == NULL) in proto_common_setup()
128 ret = proto->prt_server(dstaddr, &ctx); in proto_common_setup()
138 if (proto == NULL) { in proto_common_setup()
148 conn = proto_alloc(proto, side); in proto_common_setup()
150 if (proto->prt_close != NULL) in proto_common_setup()
151 proto->prt_close(ctx); in proto_common_setup()
301 struct proto *proto; in proto_wrap() local
305 TAILQ_FOREACH(proto, &protos, prt_next) { in proto_wrap()
306 if (strcmp(proto->prt_name, protoname) == 0) in proto_wrap()
309 if (proto == NULL) { in proto_wrap()
314 newconn = proto_alloc(proto, in proto_wrap()
446 struct proto *proto; in proto_exec() local
453 TAILQ_FOREACH(proto, &protos, prt_next) { in proto_exec()
454 if (strcmp(proto->prt_name, argv[0]) == 0) in proto_exec()
457 if (proto == NULL) { in proto_exec()
461 if (proto->prt_exec == NULL) { in proto_exec()
465 error = proto->prt_exec(argc, argv); in proto_exec()