Lines Matching +full:unit +full:- +full:addresses

64 /* tli_host - look up endpoint addresses and install conversion methods */
78 * were here. Otherwise, use the transport-independent method and stick
79 * to generic network addresses. XXX hard-coded protocol family name.
84 if ((request->config = tli_transport(request->fd)) != 0
85 && (STR_EQ(request->config->nc_protofmly, "inet") ||
86 STR_EQ(request->config->nc_protofmly, "inet6"))) {
88 if ((request->config = tli_transport(request->fd)) != 0
89 && STR_EQ(request->config->nc_protofmly, "inet")) {
91 if (request->client->unit != 0) {
93 client = *(struct sockaddr_storage *) request->client->unit->addr.buf;
94 request->client->sin = (struct sockaddr *) &client;
96 client = *(struct sockaddr_in *) request->client->unit->addr.buf;
97 request->client->sin = &client;
100 if (request->server->unit != 0) {
102 server = *(struct sockaddr_storage *) request->server->unit->addr.buf;
103 request->server->sin = (struct sockaddr *) &server;
105 server = *(struct sockaddr_in *) request->server->unit->addr.buf;
106 request->server->sin = &server;
112 request->hostname = tli_hostname;
113 request->hostaddr = tli_hostaddr;
114 request->cleanup = tli_cleanup;
118 /* tli_cleanup - cleanup some dynamically-allocated data structures */
122 if (request->config != 0)
123 freenetconfigent(request->config);
124 if (request->client->unit != 0)
125 t_free((char *) request->client->unit, T_UNITDATA);
126 if (request->server->unit != 0)
127 t_free((char *) request->server->unit, T_UNITDATA);
130 /* tli_endpoints - determine TLI client and server endpoint information */
136 int fd = request->fd;
141 * at the sender address of the pending protocol data unit without
145 * Beware of successful returns with zero-length netbufs (for example,
147 * handle that. Assume connection-less transport when TI_GETPEERNAME
156 if (ioctl(fd, TI_GETPEERNAME, &client->addr) < 0 || client->addr.len == 0) {
157 request->sink = tli_sink;
158 if (t_rcvudata(fd, client, &flags) < 0 || client->addr.len == 0) {
164 request->client->unit = client;
175 if (ioctl(fd, TI_GETMYNAME, &server->addr) < 0) {
180 request->server->unit = server;
183 /* tli_transport - find out TLI transport type */
207 if (stat(config->nc_device, &from_config) == 0) {
230 if ((config = getnetconfigent(config->nc_netid)) == 0) {
231 tcpd_warn("getnetconfigent(%s): %s", config->nc_netid, nc_sperror());
237 /* tli_hostaddr - map TLI transport address to printable address */
241 struct request_info *request = host->request;
242 struct netconfig *config = request->config;
243 struct t_unitdata *unit = host->unit; local
246 if (config != 0 && unit != 0
247 && (uaddr = taddr2uaddr(config, &unit->addr)) != 0) {
248 STRN_CPY(host->addr, uaddr, sizeof(host->addr));
253 /* tli_hostname - map TLI transport address to hostname */
257 struct request_info *request = host->request;
258 struct netconfig *config = request->config;
259 struct t_unitdata *unit = host->unit; local
262 if (config != 0 && unit != 0
263 && netdir_getbyaddr(config, &servlist, &unit->addr) == ND_OK) {
265 struct nd_hostserv *service = servlist->h_hostservs;
278 STRING_LENGTH, service->h_host);
294 for (i = 0; found == 0 && i < addr_list->n_cnt; i++) {
295 if ((ua = taddr2uaddr(config, &(addr_list->n_addrs[i]))) != 0) {
310 host->addr, STRING_LENGTH, service->h_host);
312 STRN_CPY(host->name, found ? service->h_host : paranoid,
313 sizeof(host->name));
318 /* tli_error - convert tli error number to text */
341 /* tli_sink - absorb unreceived datagram */
345 struct t_unitdata *unit; local
355 if ((unit = (struct t_unitdata *) t_alloc(fd, T_UNITDATA, T_ALL)) == 0) {
359 (void) t_rcvudata(fd, unit, &flags);
360 t_free((void *) unit, T_UNITDATA);