<commit_before>#include "tock.h"
#include "udp.h"

const int UDP_DRIVER = 0x30002;

static const int ALLOW_RX     = 0;
static const int ALLOW_RO_TX  = 1;
static const int ALLOW_CFG    = 2;
static const int ALLOW_RX_CFG = 3;

static const int SUBSCRIBE_RX = 0;
static const int SUBSCRIBE_TX = 1;

// COMMAND 0 is driver existence check
static const int COMMAND_GET_IFACES = 1;
static const int COMMAND_SEND       = 2;
static const int COMMAND_BIND       = 3;
static const int COMMAND_GET_TX_LEN = 4;

static unsigned char BUF_TX_CFG[2 * sizeof(sock_addr_t)];
static unsigned char zero_addr[2 * sizeof(sock_addr_t)];

int udp_bind(sock_handle_t *handle, sock_addr_t *addr, unsigned char *buf_bind_cfg) {
  // Pass interface to listen on and space for kernel to write src addr
  // of received packets
  // In current design, buf_bind_cfg will still be written with addresses of external
  // senders sending addresses to the bound port even if the client application has
  // not set up a receive callback on this port. Of course, the client application
  // does not have to read these addresses or worry about them.
  memcpy(&(handle->addr), addr, sizeof(sock_addr_t));<commit_msg>update to reflect condensed identifier space<commit_after>#include "tock.h"
#include "udp.h"

const int UDP_DRIVER = 0x30002;

static const int ALLOW_RX     = 0;
static const int ALLOW_RO_TX  = 0;
static const int ALLOW_CFG    = 1;
static const int ALLOW_RX_CFG = 2;

static const int SUBSCRIBE_RX = 0;
static const int SUBSCRIBE_TX = 1;

// COMMAND 0 is driver existence check
static const int COMMAND_GET_IFACES = 1;
static const int COMMAND_SEND       = 2;
static const int COMMAND_BIND       = 3;
static const int COMMAND_GET_TX_LEN = 4;

static unsigned char BUF_TX_CFG[2 * sizeof(sock_addr_t)];
static unsigned char zero_addr[2 * sizeof(sock_addr_t)];

int udp_bind(sock_handle_t *handle, sock_addr_t *addr, unsigned char *buf_bind_cfg) {
  // Pass interface to listen on and space for kernel to write src addr
  // of received packets
  // In current design, buf_bind_cfg will still be written with addresses of external
  // senders sending addresses to the bound port even if the client application has
  // not set up a receive callback on this port. Of course, the client application
  // does not have to read these addresses or worry about them.
  memcpy(&(handle->addr), addr, sizeof(sock_addr_t));
{'fraction_non_alphanumeric': 0.06936899289594652, 'fraction_numerical': 0.015879648976180525, 'mean_word_length': 4.1373390557939915, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2916398', 'n_tokens_mistral': 797, 'n_tokens_neox': 739, 'n_words': 306}