#!/bin/sh #============================================================================ # /etc/xen/vif-bridge # # Script for configuring a vif in bridged mode. # Xend calls a vif script when bringing a vif up or down. # This script is the default - but it can be configured for each vif. # # Example invocation: # # vif-bridge up domain=VM1 vif=vif1.0 bridge=xen-br0 ip="128.232.38.45/28 10.10.10.55/24" # # # Usage: # vif-bridge (up|down) {VAR=VAL}* # # Vars: # # domain name of the domain the interface is on (required). # vif vif interface name (required). # mac vif MAC address (required). # bridge bridge to add the vif to (required). # ip list of IP networks for the vif, space-separated (optional). # # up: # Enslaves the vif interface to the bridge and adds iptables rules # for its ip addresses (if any). # # down: # Removes the vif interface from the bridge and removes the iptables # rules for its ip addresses (if any). #============================================================================ # Exit if anything goes wrong set -e echo "vif-bridge $*" # Operation name. OP=$1 shift # Pull variables in args into environment for arg ; do export "${arg}" ; done # Required parameters. Fail if not set. domain=${domain:?} vif=${vif:?} mac=${mac:?} bridge=${bridge:?} # Optional parameters. Set defaults. ip=${ip:-''} # default to null (do nothing) # Are we going up or down? case $OP in up) brcmd='addif' iptcmd='-A' ;; down) brcmd='delif' iptcmd='-D' ;; *) echo 'Invalid command: ' $OP echo 'Valid commands are: up, down' exit 1 ;; esac # Don't do anything if the bridge is "null". if [ "${bridge}" == "null" ] ; then exit fi # Add/remove vif to/from bridge. brctl ${brcmd} ${bridge} ${vif} ifconfig ${vif} $OP if [ ${ip} ] ; then # If we've been given a list of IP networks, allow pkts with these src addrs. for addr in ${ip} ; do iptables ${iptcmd} FORWARD -m physdev --physdev-in ${vif} -s ${addr} -j ACCEPT done # Always allow us to talk to a DHCP server anyhow. iptables ${iptcmd} FORWARD -m physdev --physdev-in ${vif} -p udp --sport 68 --dport 67 -j ACCEPT fi option>
path: root/Projects/MediaController/makefile
blob: a87c5574c6c6c5e778cc850bf7312db5bfd828c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
#             LUFA Library
#     Copyright (C) Dean Camera, 2012.
#
#  dean [at] fourwalledcubicle [dot] com
#           www.lufa-lib.org
#
# --------------------------------------
#         LUFA Project Makefile.
# --------------------------------------

MCU          = at90usb1287
ARCH         = AVR8
BOARD        = USBKEY
F_CPU        = 8000000
F_USB        = $(F_CPU)
OPTIMIZATION = s
TARGET       = MediaController
SRC          = $(TARGET).c Descriptors.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
LUFA_PATH    = ../../LUFA/
CC_FLAGS     = -DUSE_LUFA_CONFIG_HEADER -IConfig/
LD_FLAGS     =

# Default target
all:

# Include LUFA build script makefiles
include $(LUFA_PATH)/Build/lufa.core.in
include $(LUFA_PATH)/Build/lufa.sources.in
include $(LUFA_PATH)/Build/lufa.build.in
include $(LUFA_PATH)/Build/lufa.cppcheck.in
include $(LUFA_PATH)/Build/lufa.doxygen.in
include $(LUFA_PATH)/Build/lufa.dfu.in
include $(LUFA_PATH)/Build/lufa.hid.in
include $(LUFA_PATH)/Build/lufa.avrdude.in
include $(LUFA_PATH)/Build/lufa.atprogram.in