Path: blob/main/crypto/krb5/src/lib/apputils/udppktinfo.h
39563 views
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/*2* Copyright 2016 by the Massachusetts Institute of Technology.3* All Rights Reserved.4*5* Export of this software from the United States of America may6* require a specific license from the United States Government.7* It is the responsibility of any person or organization contemplating8* export to obtain such a license before exporting.9*10* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and11* distribute this software and its documentation for any purpose and12* without fee is hereby granted, provided that the above copyright13* notice appear in all copies and that both that copyright notice and14* this permission notice appear in supporting documentation, and that15* the name of M.I.T. not be used in advertising or publicity pertaining16* to distribution of the software without specific, written prior17* permission. Furthermore if you modify this software you must label18* your software as modified software and not distribute it in such a19* fashion that it might be confused with the original M.I.T. software.20* M.I.T. makes no representations about the suitability of21* this software for any purpose. It is provided "as is" without express22* or implied warranty.23*/2425#ifndef UDPPKTINFO_H26#define UDPPKTINFO_H2728#include "k5-int.h"2930/*31* This holds whatever additional information might be needed to32* properly send back to the client from the correct local address.33*34* In this case, we only need one datum so far: On macOS, the35* kernel doesn't seem to like sending from link-local addresses36* unless we specify the correct interface.37*/38typedef union aux_addressing_info39{40int ipv6_ifindex;41} aux_addressing_info;4243krb5_error_code44set_pktinfo(int sock, int family);4546krb5_error_code47recv_from_to(int sock, void *buf, size_t len, int flags,48struct sockaddr_storage *from, struct sockaddr_storage *to,49aux_addressing_info *auxaddr);5051krb5_error_code52send_to_from(int sock, void *buf, size_t len, int flags,53const struct sockaddr *to, const struct sockaddr *from,54aux_addressing_info *auxaddr);5556#endif /* UDPPKTINFO_H */575859